Deny consent screen not working
I'm learning about IdentityServer4 by the examples they provide. I'm testing 3_ImplicitFlowAuthentication from the Quickstarts, and when i click deny on the consent screen there is an error. On the URL is http://localhost:5002/signin-oidc and nothing is showing in the browser.
On the vs console are these errors at the end:
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 POST http://localhost:5002/signin-oidc application/x-www-form-urlencoded 373
fail: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[12] Message contains error: 'access_denied', error_description: 'error_description is null', error_uri: 'error_uri is null'.
info: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[4] Error from RemoteAuthentication: Message contains error: 'access_denied', error_description: 'error_description is null', error_uri: 'error_uri is null'..
On the identityserver4_log.txt is this log
2019-11-04 14:44:06.507 -05:00 [DBG] Scopes contains offline_access, consent is required
2019-11-04 14:44:06.507 -05:00 [INF] Error: User denied consent
2019-11-04 14:44:06.510 -05:00 [INF] {"ClientId":"mvc","ClientName":"MVC Client","RedirectUri":"http://localhost:5002/signin-oidc","AllowedRedirectUris":["http://localhost:5002/signin-oidc"],"SubjectId":"2","ResponseType":"code id_token","ResponseMode":"form_post","GrantType":"hybrid","RequestedScopes":"openid profile api1 offline_access","State":"CfDJ8M2_h1HzgmhHvTB-QAGe9U0QCvcezgyFdPqMOMBPp50wSYQoPVPezEI_fkVcKJSwmDbDZA5Ebzue6qwj2Q48mIOuItFwgWwAIdAxNcHNKUfNG78aQefz0S-FmhkQgP763r_-IId74duR8Fg9RgbpRM7OpVWofPEhp8alOuOn1v2Q124SqHtvh3W77Boajp1ykg9uGXOZPFhDFxHs3bO8jUIHlmV3TLexVNRJ36kz0qwdX4ENaaD7FSVAPMfFyd1NHQ0t6pVIpthryFXpjVe3ry3aP7yBtLQE81atmtdaoBlBQWobKz_gtS8n4ZrKcysQ0LI1Yna2JRBXeQeE-n3SgnA","UiLocales":null,"Nonce":"637084934382479172.ZTBjNDZmOTItOWNhZS00MTMzLWEwNWYtMTE4YjcxYmZhYzg2MThkYjMzNDUtZWI1Ny00MzI3LTkyZjItMjU3YTRmMTY0OWRi","AuthenticationContextReferenceClasses":null,"DisplayMode":null,"PromptMode":null,"MaxAge":null,"LoginHint":null,"SessionId":"b8ad6188cac7fba97f8959dfb785f95b","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":"637084934382479172.ZTBjNDZmOTItOWNhZS00MTMzLWEwNWYtMTE4YjcxYmZhYzg2MThkYjMzNDUtZWI1Ny00MzI3LTkyZjItMjU3YTRmMTY0OWRi","state":"CfDJ8M2_h1HzgmhHvTB-QAGe9U0QCvcezgyFdPqMOMBPp50wSYQoPVPezEI_fkVcKJSwmDbDZA5Ebzue6qwj2Q48mIOuItFwgWwAIdAxNcHNKUfNG78aQefz0S-FmhkQgP763r_-IId74duR8Fg9RgbpRM7OpVWofPEhp8alOuOn1v2Q124SqHtvh3W77Boajp1ykg9uGXOZPFhDFxHs3bO8jUIHlmV3TLexVNRJ36kz0qwdX4ENaaD7FSVAPMfFyd1NHQ0t6pVIpthryFXpjVe3ry3aP7yBtLQE81atmtdaoBlBQWobKz_gtS8n4ZrKcysQ0LI1Yna2JRBXeQeE-n3SgnA","x-client-SKU":"ID_NETSTANDARD1_4","x-client-ver":"5.2.0.0"},"$type":"AuthorizeRequestValidationLog"}
So, what is wrong with this example?
It is working - you need to implement code in your client app to handle the access denied. There's an error event on the OIDC handler.
Thanks @leastprivilege , can you provide us some code guidance on how/where work with this event handler?
Well - handle the event. You probably want to redirect to some error page...
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.