locked
callback to angular2 return HTTP Error 404.0 - Not Found using and identityServer4 RRS feed

  • Question

  • User-687613544 posted

    Hi, 

    I try to use angular2 and identityServer4 but after login , a got a HTTP Error 404.0 - Not Found  (The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.)  it seems the error is related to IIS  ,but how can I resolve it ?

    IdentityServer configuration :

     private readonly List<Client> clients = new List<Client>
            {
                new Client
                {
                    ClientId = "angular_spa",
                    ClientName = "Angular 4 Client",
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowedScopes = new List<string> {"openid", "profile", "api1"},
                    RedirectUris = new List<string> {"http://localhost:4200/auth-callback"},
                    PostLogoutRedirectUris = new List<string> {"http://localhost:4200/"},
    
                    AllowedCorsOrigins = new List<string> {"http://localhost:4200"},
                    AllowAccessTokensViaBrowser = true
                }
            };

    Angular2 configuration

    export function getClientSettings(): UserManagerSettings {
      return {
        authority: 'http://localhost:5555/',
        client_id: 'angular_spa',
        redirect_uri: 'http://localhost:4200/auth-callback',
        post_logout_redirect_uri: 'http://localhost:4200/',
        response_type: "id_token token",
        scope: "openid profile api1",
        filterProtocolClaims: true,
        loadUserInfo: true
      };
    }

    AppRoutingModule

    @NgModule({
        imports: [
            RouterModule.forRoot([
                { path: 'home', component: HomeComponent },
                {
                    path: 'products',
                    canActivate: [AuthGuard],
                    data: { preload: true },
                    loadChildren: 'app/products/product.module#ProductModule'
                },
                {
                    path: 'protected',
                    component: ProtectedComponent,
                    canActivate: [AuthGuardService]
                },
                {
                    path: 'auth-callback',
                    component: AuthCallbackComponent
                },
                {
                    path: 'call-api',
                    component: CallApiComponent,
                    canActivate: [AuthGuardService]
                },
                { path: '', redirectTo: 'home', pathMatch: 'full' },
                { path: '**', component: PageNotFoundComponent }
            ])
        ],
    
        exports: [RouterModule]
    })
    export class AppRoutingModule { }

    the route http://localhost:4200/auth-callback  exist very well

    <a routerLink="/auth-callback">auth-callback</a>

    If I click on the link auth-callback, the page auth-callback is displayed.  But does not displayed if we redirect from auth2.

    the error message is : HTTP Error 404.0 - Not Found

    the redirection url is : 

    http://localhost:4200/auth-callback#id_token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjODZhZGMzNmFjOGVlZDcyYjk1NmMyMGM0OTNmYWExIiwidHlwIjoiSldUIn0.eyJuYmYiOjE1MDYyNzI0OTQsImV4cCI6MTUwNjI3Mjc5NCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1NTU1IiwiYXVkIjoiYW5ndWxhcl9zcGEiLCJub25jZSI6IjM4M2EyMDhlYTk5YjQ2YWQ5ODkxYWM4ZDQwNzliMjI2IiwiaWF0IjoxNTA2MjcyNDk0LCJhdF9oYXNoIjoiU1lPZmZxX0tZOUV4NUY1QlJwM2FKUSIsInNpZCI6IjMxM2E2ZDgxNmFkZjhiMGYyZmViOTNlMDMyOTBjYzdlIiwic3ViIjoiODE4NzI3IiwiYXV0aF90aW1lIjoxNTA2MjcyNDI2LCJpZHAiOiJsb2NhbCIsImFtciI6WyJwd2QiXX0.PAEE9cuc5G3MCtda0LXgBOMASQvmekqNNfMvf-JQxV6ENOG7usuztR6MK0krJ2O_IZPDcbxkc4F1nAR0AmYBDZX9RGQqu9q-ylUm78P_woeOTwtKh7NZbHpbrWLXrI1BpZeifijkXP35YlLqEulhPNGJd7wXh-oSXASU_znCV4B9RmuBjlH1Po7hKk2KP9IsXTZBeSHbnzVV5rSO9WLGJQkxKEJ0V8uuWLdOux6kpUNtYYEnhixx7gJCLBfFSNmdKiH4GsXWb41HMCpbLMwiflu60Sr-HcsiP_eYYRJaA8l6JvSm4lEHrJ6PRpNhAWVHrEc6BxySr-NfMonZt53gtw&access_token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjODZhZGMzNmFjOGVlZDcyYjk1NmMyMGM0OTNmYWExIiwidHlwIjoiSldUIn0.eyJuYmYiOjE1MDYyNzI0OTQsImV4cCI6MTUwNjI3NjA5NCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1NTU1IiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTU1NS9yZXNvdXJjZXMiLCJhcGkxIl0sImNsaWVudF9pZCI6ImFuZ3VsYXJfc3BhIiwic3ViIjoiODE4NzI3IiwiYXV0aF90aW1lIjoxNTA2MjcyNDI2LCJpZHAiOiJsb2NhbCIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJhcGkxIl0sImFtciI6WyJwd2QiXX0.kE6cbK1eVTcbneQo2Yw7voHO2soveP-LzMIblE-VyAyxUhtCeMwiHYeR2Ffu76fK9doeROFMaU0C_Z90UFwt2Z_uThPDJpx5FfmxInapLdcsBFSlUvPEsRmJiEuvRBYfPdBwrFw57DE7j3cWXOmHOQpx2co8840b83MU7zJIrqDJrJhjXNwhkDrGfa0v2vPLMfvf7niZtn4a5lGXKkzf0z2rx1aNfsvM84xYD4SQDvKnTnjG-dd4PBIfe7UXB9x1Cti60f3676MTvIMmVofjks7MqhdnustCfuZC1R3SZycdvL7foo_DkQ7PQSy2WIKgdcferhLbuDaHMe8zSah3ug&token_type=Bearer&expires_in=3600&scope=openid%20profile%20api1&state=f0c79f45772b491aaf7f915ea7c09f90&session_state=1p_ClpBY9KDR9v-FnbBlJcTEAKtvtbwWukdgi_mV3TQ.d22413b2a257b070c4ea791b02f9564a

    Best regards
      

    Tuesday, September 26, 2017 2:49 PM

All replies