Identity Server redirect to React Native error

Viewed 547

I have an Identity Server running.

I try to make an authentication from a React Native App.

I am using react-native-app-auth package to do authentication.

When I do login from the app, I have the Identity Server Login page that is loaded in a browser. When I login with the good credential, Identity Server return me an error "The view 'Redirect' was not found..."

Do you know What's missing ? I expect to be redirected to my app after success login ...

Here is my config:

Identity Server config :

public static Client GetMobileClient()
        {
            return new Client
            {
                ClientId = "mobile.code",
                ClientName = "Mobile Client (Code with PKCE)",
                RequireClientSecret = false,
                RedirectUris = { "com.server.acc:/oauthredirect" },
                AllowedGrantTypes = GrantTypes.Code,
                RequirePkce = true,
                AllowedScopes = { "openid", "profile" , "email", "api.read" },
                AllowOfflineAccess = true
            };
        } 

And here is my React Native Config:

Build.gradle

manifestPlaceholders = [ appAuthRedirectScheme: 'com.server.acc' ]

Login.tsx:

import { authorize, refresh, AuthConfiguration } from 'react-native-app-auth';
...

const config: AuthConfiguration = {
            issuer: 'https://acc.server.com:44344',
            clientId: 'mobile.code',
            redirectUrl: 'com.server.acc:/oauthredirect',
            scopes: ['openid', 'profile', 'email', 'api.read']
        };
          
const authState = await authorize(config);

So once I do "await authorize(config);", we have the login page that is loaded, after putting the good credentials, I have this error :

enter image description here

Why is he looking for .cshtml pages ???

Many Thanks ! I am blocked during 3 days for this !

1 Answers

Not sure ,but perhaps you should add HTTPS:// infront of the URL here:

redirectUrl: 'com.server.acc:/oauthredirect',
Related