MVC Quickstart does not log in #1885
Comments
This shows me you're not setting the schemes properly. |
Hmm, I'm just running the sample directly though. Here is the startup for the sample I'm using: EDIT: I debugged the application and see that it successfully logs me in, its when it gets to the RedirectToLocal it ends up getting sent back to the login page. Here is the returnUrl: /connect/authorize/callback?client_id=mvc&redirect_uri=http%3A%2F%2Flocalhost%3A5002%2Fsignin-oidc&response_type=code%20id_token&scope=openid%20profile%20api1%20offline_access&response_mode=form_post&nonce=636490923885536368.NGNiZGRhMjgtZGQ2NC00ZmYxLWIyZTMtYjljNjU0YWE3OWZkNjI1YjY0ZDAtZjYzNC00OGRhLWE5YTctNzU0NzEwMDdmMWE1&state=CfDJ8OjFhWHnTLBEporSKt_A6SqUH9w0t_56z2jzQ4sCF0LtSl0bB_ixV5DrhAhFVPBt1VOJqmYjjDET15DaS8fwjHis22ZayFuxrROsCabDIZzHjhFsOsBwDVno8AIaQXVQ0zQGtEx4FErmkknGLOE2z33VfqT6p55ryTafPxjWEHmKfD92BdoN0ynScRPv2WkTnWrLu-zjyx-iH9LUpKPmy18V-NI5aDR5hpCPEHyNLsuEPm91fndCsln5ypZ5ESw9v-6gMwcwOrV1g-J2foVL1zRkmcwtlJoLwJEBWVLhzgoX5RNEsucGBbJjTASPsqslDDgISwomo3YEyTrSXZqfpMs&x-client-SKU=ID_NET&x-client-ver=2.1.4.0 |
@brockallen Could you let me know what the default schemes should be for these?
|
Have you made any modifications to the completed code for the quickstart? If so, then diff those with our version to see what might be causing the issue. |
I have not made any modifications to the source, running as is (downloaded again to make sure). I decided to test some other quickstarts, and was able to get the Mvc Client sample working using Quickstart 7(The javascript client sample, no AspNetIdentity or EF), but was not able to get the Mvc Client working with Quickstart 6 (the AspNetIdentity sample). I ran into the same problem of an infinite login loop with this one. The Mvc Client startup is the same in both Quickstart 6 and 7. The Mvc client definitions in the IdSrv Config of both 6 and 7 are also the same (6 has Require consent = true, but commenting this out does not fix the issue). The biggest differences are in the Identity Server startup files in 6 and 7, as well as the Login methods of the Account controller. Could you try running Quickstart 6 and see if you are having the same issues? When I launch the Identity Server in Quickstart 6 this is the console output: info: IdentityServer4.Startup[0] |
I am having the very same issue. Worked my way through all the quick start examples (with the exception of the Google one) and got them all working. |
I just re-ran the quickstart 6 and logged into the MVC client and it's all working fine for me. |
And @AleksandrAlbert -- I was mistaken -- the schemes for that sample look correct. |
I was following these instructions: http://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html I cannot clone this sample because on windows 7 even when using a rather short path the file names are too long: |
Cloned everything straight to c:\q\ and that succeeded. |
You mean the IdentityServer host? |
yes |
Well, I'm stumped. My IdSvr host is at the same URL. And the client is http://localhost:5002/. |
Works if the client is opened in Chrome but fails in Firefox. Well, maybe it is some kind of chaching issue. I was running quickstarts 3 and 4 before this one. |
Yes, I deleted all cookies related to localhost:5000 in Firefox and then it worked. I should mention that restarting the computer did not help at all. |
So @AleksandrAlbert can you see if that's also your issue? |
Ah Yes! Clearing my localhost cookies fixed the issue with Quickstart 6. I will test with my main project now. I wonder what caused this, clearing cookies is probably not something an end user would think of doing |
I wonder if you had clicked the "remember my login"? also, i often see this type of problem on localhost since those cookies are shared across ports and the default cookie name tends to get used across several apps. |
I had the exact same issue and fixed by clearing everything in my browser. Must be a super weird cookie issue. |
Hello, I am having the same issue and bagging my head... IdentityServer4 with ,Net Core 2.1 and ASP .Net identity and Entity framework as storage. All the steps taken the identity server comes up fine but when client tries to login the server side I see a message .. Showing login: User is not authenticated The client is MVC client based on Quickstart8.. BTW I get the same issue with JS client. Any pointers will be helpful. some relevant log |
Same Issue for me : 2019-06-21 11:41:54.396 +02:00 [INF] Starting IdentityServer4 version 2.4.0.0 2019-06-21 11:41:55.103 +02:00 [INF] Showing login: User is not authenticated |
Hi I am also facing same issue can anybody helps. below is my log |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hey, I am trying to get the IdentityServer with EF sample to run but am running into a strange problem. When I click on the 'Secure' tab in the MVC home page, it takes me to the IS4 login. However after I enter my credentials and click log in, I get redirected back to the login page. I have verified that the User exists in the database. Here are the logs I get making these requests:
2017-12-16 17:21:33.539 -04:00 [DBG] Using Identity.Application as default scheme for authentication
2017-12-16 17:21:33.583 -04:00 [DBG] Using Identity.External as default scheme for sign-in
2017-12-16 17:21:33.585 -04:00 [DBG] Using Identity.External as default scheme for sign-out
2017-12-16 17:21:33.585 -04:00 [DBG] Using Identity.Application as default scheme for challenge
2017-12-16 17:21:33.586 -04:00 [DBG] Using Identity.Application as default scheme for forbid
2017-12-16 17:21:33.720 -04:00 [DBG] Starting token cleanup
2017-12-16 17:21:36.466 -04:00 [DBG] Request path /connect/authorize matched to endpoint type Authorize
2017-12-16 17:21:36.499 -04:00 [DBG] Endpoint enabled: Authorize, successfully created handler: IdentityServer4.Endpoints.AuthorizeEndpoint
2017-12-16 17:21:36.502 -04:00 [INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.AuthorizeEndpoint for /connect/authorize
2017-12-16 17:21:36.514 -04:00 [DBG] Start authorize request
2017-12-16 17:21:36.531 -04:00 [DBG] No user present in authorize request
2017-12-16 17:21:36.539 -04:00 [DBG] Start authorize request protocol validation
2017-12-16 17:21:37.900 -04:00 [DBG] mvc found in database: true
2017-12-16 17:21:37.915 -04:00 [DBG] Checking for PKCE parameters
2017-12-16 17:21:37.917 -04:00 [DBG] No PKCE used.
2017-12-16 17:21:38.017 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:21:38.345 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:21:38.370 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:21:38.382 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:21:38.398 -04:00 [DBG] Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator
2017-12-16 17:21:38.495 -04:00 [INF] ValidatedAuthorizeRequest
{
"ClientId": "mvc",
"ClientName": "MVC Client",
"RedirectUri": "http://localhost:5002/signin-oidc",
"AllowedRedirectUris": [
"http://localhost:5002/signin-oidc"
],
"SubjectId": "anonymous",
"ResponseType": "code id_token",
"ResponseMode": "form_post",
"GrantType": "hybrid",
"RequestedScopes": "openid profile api1 offline_access",
"State": "CfDJ8OjFhWHnTLBEporSKt_A6SqBDQbwqg26gGARan3UYPBz6RCfh0BazL0IWdxWjjgzJU7Qknp01KHWRMy_VSdJ8H7Jbbwsxhj2c5JZ8Jk5NFb-EASixxCCE3UH19kdWu9H_MpW33PqRVIAkQGuk7lVLmaRa85bWMYEMIh8N5zUbXjDCi90qj_lokqwxMmlZ3avfgVo3NaTEGh94CZzvEa5I33D2WbSx1h4xA2SVOZqJNWZESWCQazUuQt8745dUVe0fx8fecSDBlZJK2F_QNh5I-6FPw7uCrlZUKYNhbkWUdyvNazMIVQIrxq8RUcjgfL-_cYIVyPi5cVUPtHg90uuNJ4",
"Nonce": "636490560962891702.OGQ5ZjE0OGQtN2Y1My00NzRhLTg0MjktZWFkMTU2YmViODhjMDk2YTc0M2YtNGY1MC00M2JiLTlhNjQtN2RjMjE1NDZmYzJh",
"Raw": {
"client_id": "mvc",
"redirect_uri": "http://localhost:5002/signin-oidc",
"response_type": "code id_token",
"scope": "openid profile api1 offline_access",
"response_mode": "form_post",
"nonce": "636490560962891702.OGQ5ZjE0OGQtN2Y1My00NzRhLTg0MjktZWFkMTU2YmViODhjMDk2YTc0M2YtNGY1MC00M2JiLTlhNjQtN2RjMjE1NDZmYzJh",
"state": "CfDJ8OjFhWHnTLBEporSKt_A6SqBDQbwqg26gGARan3UYPBz6RCfh0BazL0IWdxWjjgzJU7Qknp01KHWRMy_VSdJ8H7Jbbwsxhj2c5JZ8Jk5NFb-EASixxCCE3UH19kdWu9H_MpW33PqRVIAkQGuk7lVLmaRa85bWMYEMIh8N5zUbXjDCi90qj_lokqwxMmlZ3avfgVo3NaTEGh94CZzvEa5I33D2WbSx1h4xA2SVOZqJNWZESWCQazUuQt8745dUVe0fx8fecSDBlZJK2F_QNh5I-6FPw7uCrlZUKYNhbkWUdyvNazMIVQIrxq8RUcjgfL-_cYIVyPi5cVUPtHg90uuNJ4",
"x-client-SKU": "ID_NET",
"x-client-ver": "2.1.4.0"
}
}
2017-12-16 17:21:38.516 -04:00 [INF] Showing login: User is not authenticated
2017-12-16 17:21:38.742 -04:00 [INF] AuthenticationScheme: Identity.External signed out.
2017-12-16 17:21:38.759 -04:00 [DBG] Start authorize request protocol validation
2017-12-16 17:21:38.771 -04:00 [DBG] mvc found in database: true
2017-12-16 17:21:38.771 -04:00 [DBG] Checking for PKCE parameters
2017-12-16 17:21:38.774 -04:00 [DBG] No PKCE used.
2017-12-16 17:21:38.781 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:21:38.791 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:21:38.801 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:21:38.810 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:21:38.812 -04:00 [DBG] Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator
2017-12-16 17:22:00.441 -04:00 [DBG] Augmenting SignInContext
2017-12-16 17:22:00.455 -04:00 [INF] AuthenticationScheme: Identity.Application signed in.
2017-12-16 17:22:00.461 -04:00 [INF] User logged in.
2017-12-16 17:22:00.473 -04:00 [DBG] Request path /connect/authorize/callback matched to endpoint type Authorize
2017-12-16 17:22:00.477 -04:00 [DBG] Endpoint enabled: Authorize, successfully created handler: IdentityServer4.Endpoints.AuthorizeCallbackEndpoint
2017-12-16 17:22:00.479 -04:00 [INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.AuthorizeCallbackEndpoint for /connect/authorize/callback
2017-12-16 17:22:00.489 -04:00 [DBG] Start authorize callback request
2017-12-16 17:22:00.495 -04:00 [DBG] No user present in authorize request
2017-12-16 17:22:00.496 -04:00 [DBG] Start authorize request protocol validation
2017-12-16 17:22:00.510 -04:00 [DBG] mvc found in database: true
2017-12-16 17:22:00.510 -04:00 [DBG] Checking for PKCE parameters
2017-12-16 17:22:00.515 -04:00 [DBG] No PKCE used.
2017-12-16 17:22:00.527 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:22:00.537 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:22:00.544 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:22:00.554 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:22:00.556 -04:00 [DBG] Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator
2017-12-16 17:22:00.562 -04:00 [INF] ValidatedAuthorizeRequest
{
"ClientId": "mvc",
"ClientName": "MVC Client",
"RedirectUri": "http://localhost:5002/signin-oidc",
"AllowedRedirectUris": [
"http://localhost:5002/signin-oidc"
],
"SubjectId": "anonymous",
"ResponseType": "code id_token",
"ResponseMode": "form_post",
"GrantType": "hybrid",
"RequestedScopes": "openid profile api1 offline_access",
"State": "CfDJ8OjFhWHnTLBEporSKt_A6SqBDQbwqg26gGARan3UYPBz6RCfh0BazL0IWdxWjjgzJU7Qknp01KHWRMy_VSdJ8H7Jbbwsxhj2c5JZ8Jk5NFb-EASixxCCE3UH19kdWu9H_MpW33PqRVIAkQGuk7lVLmaRa85bWMYEMIh8N5zUbXjDCi90qj_lokqwxMmlZ3avfgVo3NaTEGh94CZzvEa5I33D2WbSx1h4xA2SVOZqJNWZESWCQazUuQt8745dUVe0fx8fecSDBlZJK2F_QNh5I-6FPw7uCrlZUKYNhbkWUdyvNazMIVQIrxq8RUcjgfL-_cYIVyPi5cVUPtHg90uuNJ4",
"Nonce": "636490560962891702.OGQ5ZjE0OGQtN2Y1My00NzRhLTg0MjktZWFkMTU2YmViODhjMDk2YTc0M2YtNGY1MC00M2JiLTlhNjQtN2RjMjE1NDZmYzJh",
"Raw": {
"client_id": "mvc",
"redirect_uri": "http://localhost:5002/signin-oidc",
"response_type": "code id_token",
"scope": "openid profile api1 offline_access",
"response_mode": "form_post",
"nonce": "636490560962891702.OGQ5ZjE0OGQtN2Y1My00NzRhLTg0MjktZWFkMTU2YmViODhjMDk2YTc0M2YtNGY1MC00M2JiLTlhNjQtN2RjMjE1NDZmYzJh",
"state": "CfDJ8OjFhWHnTLBEporSKt_A6SqBDQbwqg26gGARan3UYPBz6RCfh0BazL0IWdxWjjgzJU7Qknp01KHWRMy_VSdJ8H7Jbbwsxhj2c5JZ8Jk5NFb-EASixxCCE3UH19kdWu9H_MpW33PqRVIAkQGuk7lVLmaRa85bWMYEMIh8N5zUbXjDCi90qj_lokqwxMmlZ3avfgVo3NaTEGh94CZzvEa5I33D2WbSx1h4xA2SVOZqJNWZESWCQazUuQt8745dUVe0fx8fecSDBlZJK2F_QNh5I-6FPw7uCrlZUKYNhbkWUdyvNazMIVQIrxq8RUcjgfL-_cYIVyPi5cVUPtHg90uuNJ4",
"x-client-SKU": "ID_NET",
"x-client-ver": "2.1.4.0"
}
}
2017-12-16 17:22:00.570 -04:00 [INF] Showing login: User is not authenticated
2017-12-16 17:22:00.580 -04:00 [INF] AuthenticationScheme: Identity.External signed out.
2017-12-16 17:22:00.581 -04:00 [DBG] Start authorize request protocol validation
2017-12-16 17:22:00.591 -04:00 [DBG] mvc found in database: true
2017-12-16 17:22:00.592 -04:00 [DBG] Checking for PKCE parameters
2017-12-16 17:22:00.593 -04:00 [DBG] No PKCE used.
2017-12-16 17:22:00.601 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:22:00.610 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:22:00.617 -04:00 [DBG] Found ["openid","profile"] identity scopes in database
2017-12-16 17:22:00.626 -04:00 [DBG] Found ["api1"] API scopes in database
2017-12-16 17:22:00.627 -04:00 [DBG] Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator
2017-12-16 17:22:03.763 -04:00 [INF] Clearing 0 tokens
2017-12-16 17:22:07.013 -04:00 [DBG] TaskCanceledException. Exiting.
2017-12-16 17:22:07.040 -04:00 [DBG] Stopping token cleanup
The text was updated successfully, but these errors were encountered: