Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denying authorization access to a Blazor webassembly client #28344

Open
jayrulez opened this issue Dec 3, 2020 · 0 comments
Open

Denying authorization access to a Blazor webassembly client #28344

jayrulez opened this issue Dec 3, 2020 · 0 comments

Comments

@jayrulez
Copy link

@jayrulez jayrulez commented Dec 3, 2020

Describe the bug

I am using Openiddict as an OpenId Connect server with a blazor webassembly client.

If I attempt to access a protected route in the client, it redirects me to the oidc server (based on Openiddict) for auth*n.
If I provide access to the blazor client then it works as expected.

However, If I deny access to the blazor client then I believe the RemoteAuthenticatorViewCore is behaving incorrectly.
The expected behavior is that the client is redirected to the login failed callback route where the error message returned by the oidc server (in this case: "The authorization was denied by the end user.") is displayed to the user.

However, the client stays on this view:

image

I think the issue is in this method:

I'm not having a good time with debugging a blazor webassembly client so I cannot confirm this but I think this method is hitting one of the cases that throws an exception or the empty RemoteAuthenticationStatus.OperationCompleted case.

The login callback preview shows this:
image

So I am leaning to the former.

To Reproduce

You can reproduce the issue by running this sample project here:
https://github.com/openiddict/openiddict-samples/tree/dev/samples/Balosar

It doesn't require any setup so it should take just a few minutes.

Just click the "Fetch Data" component link. It will redirect you to the auth server for. you can then create an account and login. (I suggest creating an account beforehand or disabling email requirement for sign in as it breaks the flow by default.). Anyway, once you have an account you can attempt to authorize the client. When it prompts for consent, deny the client and you will be returned to the view in the first screenshot.

I first contacted @kevinchalet about this issue. He says as I expected that it is not an issue with Openiddict.

Further technical details

$ dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.