-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
bug: Blazor Server setting a Resource will fail authentication #29
Comments
I further investigated the issue and created an account for Logto cloud. When I use the Logto cloud everything works fine when I set a Resource. |
@Json-exe yes, its' because of the https. Can you configure the local host for HTTPS? |
I'll see if I can get a reverse proxy to run locally or how I can get logto to run under https on my machine. |
I set up a Logto Instance on my server and put NGINX in front of it. I issued a certificate from Lets Encrypt and enabled https. But the issue with the Ressource still persists. Also in the example App I dont get Authenticated if I set a resource. |
I now tried the following on my local machine:
Once again I could not be authenticated although now even localhost had https (I also tried that on my server where nginx is then proxying to https://127.0.0.1:3002 and 3001 but that did not work either). |
I have made some more tests. I have disabled Cloudflare to check if that was the problem and have created the same configuration I have used in Logto Cloud. My issue sadly still persists.
My Logto Instance Logs: {
"key": "Interaction.Create",
"result": "Success",
"ip": "---.---.--.--",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36",
"userId": "g8jqzitis1fe",
"applicationId": "rzoeztxfntj0f4us6szbz",
"sessionId": "kkO1S80zXhouQyjgmkd4h",
"params": {
"nonce": "638635631980426641.Mzc4MjBiYjMtZjg3MC00NTE2LTlkNzgtOTQwZTY1NmI1ZThmZDUyZWRiYjEtMWM5Ni00MGVhLThjODctM2M2YjJlY2U1NGRj",
"scope": "openid offline_access profile",
"state": "CfDJ8PciJX1BI1tMhWzI08s0l5WsI65ESSIc9_96lYVmgnMetyCl5BGBWccyImGopc8RQOnXJOglvTc1KORX-beSvSCVYAYwrkdDuYoLKdfn1V1rFYb5uvm_k1RnlYHXpYHnFBZs5x0rFW6eY-MhXkI8HSPJyxApVx5aPEjuKotChY-3QkweO-q_cYpKFK37KtQDcWXwzwRxyit3LGmyKglYALRp_lTlBt5n7qGCzbzp-YT_cKJgf8QhQNif3clKW_12XBUvW4cp-TZvy98nnOfUlw0OYCyxaEpyzrAz8fLVIOq8M4NwRy_wa-JrOQBB18SykTgOUoHi1GYO_9yv4pmnAOWDqtLdS0CLutQLajtDr229CLy-48MtQn9ROO7N6z_SsQ",
"prompt": "consent",
"resource": "http://localhost:3212/",
"client_id": "rzoeztxfntj0f4us6szbz",
"redirect_uri": "https://localhost:44319/Callback",
"response_mode": "form_post",
"response_type": "code",
"code_challenge": "aUW0QhTkN3dSfi0H1Y1OBo-ZBLcQH29rkKiXZLj_Oc8",
"code_challenge_method": "S256"
},
"prompt": {
"name": "consent",
"details": {
"missingOIDCScope": [
"openid",
"offline_access",
"profile"
]
},
"reasons": [
"consent_prompt",
"op_scopes_missing"
]
},
"interactionId": "aM-nCV2qU0qYnImOhASAB"
} Exchange: {
"key": "ExchangeTokenBy.AuthorizationCode",
"result": "Success",
"ip": "---.---.--.--",
"userAgent": "Microsoft ASP.NET Core OpenIdConnect handler",
"userId": "g8jqzitis1fe",
"applicationId": "rzoeztxfntj0f4us6szbz",
"params": {
"code": "IFjuozuL37jbMMwT3bu50poMpAGgOpmNa94sxu1zdZo",
"client_id": "rzoeztxfntj0f4us6szbz",
"grant_type": "authorization_code",
"redirect_uri": "https://localhost:44319/Callback",
"client_secret": "#internal:83N3UwftTlIRqeXKSgMiVFz98Bv1fv8B",
"code_verifier": "OX4EDW35U5l9wCPY_8Gxzvo004SFjfNzYA6s335UKsE"
},
"scope": "openid offline_access profile",
"tokenTypes": [
"AccessToken",
"RefreshToken",
"IdToken"
],
"applicationSecret": {
"name": "Default secret"
}
} And my browser network logs: Hope that helps. |
Describe the bug
I have a Blazor Server project, where I have added Logto as an Identity Provider. I have created a Traditional Web App in Logto and provided all information for the AddLogotAuthentication call. I tested it and everything worked fine. Than I added a API Resource to Logto and added the ID of it to
options.Resource
. But after adding that and starting the App, I never get Authenticated again. Always when clicking login, and logging in on logto, I get redirected to my page and it still says Login. Only when I remove the Resource again, my login works fine.I currently tried several Resource IDs:
I can also reproduce that behaviour in the Blazor Sample App.
If you need more information, I am happy to share ^^
Expected behavior
I still get Authenticated correctly on my Application, and can retrieve my Access Token for my WebAPI.
How to reproduce?
Download this repo, open the Blazor Server Project, add the appsettings, add a Traditional Web App to logto and fill the required information in the appsettings. Add a API Resource to logto and add the resource to the appsettings. Try to login.
Context
Screenshots
Before Sign-in:
After Sign-In:
The text was updated successfully, but these errors were encountered: