-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Hi, I have trouble with login by **initImplicitFlow()** call
config:
export const authConfig: AuthConfig = { issuer: 'https://localhost:44303', redirectUri: 'http://localhost:4200/private', responseType: 'id_token token', clientId: 'client_id_js', scope: 'ApiOne', silentRefreshRedirectUri: 'http://localhost:4200/silent-refresh.html', postLogoutRedirectUri: "http://localhost:4200/login", }
app.component.ts:
constructor(private oauthService: OAuthService) { this.oauthService.configure(authConfig); this.oauthService.tokenValidationHandler = new JwksValidationHandler(); this.oauthService.loadDiscoveryDocumentAndTryLogin(); }
also OAuthModule connected in app.module.ts
login.component.ts:
initImplicitFlow call:
onSubmit(): void { this.oauthService.initImplicitFlow(); }
VS logs:
[18:39:32 Debug] IdentityServer4.Hosting.CorsPolicyProvider CORS request made for path: /.well-known/openid-configuration from origin: http://localhost:4200 [18:39:32 Debug] IdentityServer4.EntityFramework.Services.CorsPolicyService Origin http://localhost:4200 is allowed: True [18:39:32 Debug] IdentityServer4.Hosting.CorsPolicyProvider CorsPolicyService allowed origin: http://localhost:4200 [18:39:32 Debug] IdentityServer4.Hosting.EndpointRouter Request path /.well-known/openid-configuration matched to endpoint type Discovery [18:39:32 Debug] IdentityServer4.Hosting.EndpointRouter Endpoint enabled: Discovery, successfully created handler: IdentityServer4.Endpoints.DiscoveryEndpoint [18:39:32 Information] IdentityServer4.Hosting.IdentityServerMiddleware Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryEndpoint for /.well-known/openid-configuration [18:39:32 Debug] IdentityServer4.Endpoints.DiscoveryEndpoint Start discovery request [18:39:32 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore Found ["openid", "ApiOne"] as all scopes in database [18:39:37 Debug] IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler AuthenticationScheme: Bearer was not authenticated. [18:39:37 Debug] IdentityServer4.Hosting.CorsPolicyProvider CORS request made for path: /account/login from origin: http://localhost:4200 but was ignored because path was not for an allowed IdentityServer CORS endpoint [18:39:37 Information] Identity_auth.Controllers.AccountController User with email: evgenij.merchansky@gmail.com try to login. [18:39:37 Debug] IdentityServer4.Hosting.IdentityServerAuthenticationService Augmenting SignInContext [18:39:37 Debug] IdentityServer4.Hosting.IdentityServerAuthenticationService Adding idp claim with value: local [18:39:37 Debug] IdentityServer4.Hosting.IdentityServerAuthenticationService Adding auth_time claim with value: 1579106377 [18:39:37 Information] Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler AuthenticationScheme: Identity.Application signed in. [18:39:37 Debug] IdentityServer4.Hosting.EndpointRouter Request path /connect/authorize matched to endpoint type Authorize [18:39:37 Debug] IdentityServer4.Hosting.EndpointRouter Endpoint enabled: Authorize, successfully created handler: IdentityServer4.Endpoints.AuthorizeEndpoint [18:39:37 Information] IdentityServer4.Hosting.IdentityServerMiddleware Invoking IdentityServer endpoint: IdentityServer4.Endpoints.AuthorizeEndpoint for /connect/authorize [18:39:37 Debug] IdentityServer4.Endpoints.AuthorizeEndpoint Start authorize request [18:39:37 Debug] IdentityServer4.Endpoints.AuthorizeEndpoint No user present in authorize request [18:39:37 Debug] IdentityServer4.Validation.AuthorizeRequestValidator Start authorize request protocol validation [18:39:39 Information] IdentityServer4.EntityFramework.TokenCleanupService Removing 0 grants [18:39:39 Information] IdentityServer4.EntityFramework.TokenCleanupService Removing 0 device flow codes [18:39:47 Debug] IdentityServer4.EntityFramework.Stores.ClientStore client_id_js found in database: True [18:39:47 Debug] IdentityServer4.Stores.ValidatingClientStore client configuration validation for client client_id_js succeeded. [18:39:47 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore Found ["openid"] identity scopes in database [18:39:47 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore Found ["ApiOne"] API scopes in database [18:39:47 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore Found ["openid"] identity scopes in database [18:39:47 Debug] IdentityServer4.EntityFramework.Stores.ResourceStore Found ["ApiOne"] API scopes in database [18:39:47 Debug] IdentityServer4.Validation.AuthorizeRequestValidator Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator [18:39:47 Debug] IdentityServer4.Endpoints.AuthorizeEndpoint ValidatedAuthorizeRequest {"ClientId": "client_id_js", "ClientName": null, "RedirectUri": "http://localhost:4200/private", "AllowedRedirectUris": ["http://localhost:4200", "http://localhost:4200/private", "http://localhost:4200/login", "http://localhost:4200/silent-refresh.html"], "SubjectId": "anonymous", "ResponseType": "id_token token", "ResponseMode": "fragment", "GrantType": "implicit", "RequestedScopes": "openid ApiOne", "State": "ILV9RG2iM0u416xqojQ7rn06NLFk8LumkeJohqZtizjhd", "UiLocales": null, "Nonce": "ILV9RG2iM0u416xqojQ7rn06NLFk8LumkeJohqZtizjhd", "AuthenticationContextReferenceClasses": null, "DisplayMode": null, "PromptMode": null, "MaxAge": null, "LoginHint": null, "SessionId": null, "Raw": {"response_type": "id_token token", "client_id": "client_id_js", "state": "ILV9RG2iM0u416xqojQ7rn06NLFk8LumkeJohqZtizjhd", "redirect_uri": "http://localhost:4200/private", "scope": "openid ApiOne", "nonce": "ILV9RG2iM0u416xqojQ7rn06NLFk8LumkeJohqZtizjhd"}, "$type": "AuthorizeRequestValidationLog"} [18:39:47 Information] IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator Showing login: User is not authenticated
Please, can help me?