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

Fix: LogtoCookieContextManager setting double slash in fetch token request uri #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Json-exe
Copy link

@Json-exe Json-exe commented Oct 4, 2024

Summary

This pull request closes #29 . The problem was the following code:

var request = new HttpRequestMessage(HttpMethod.Post, $"{logtoOptions.Endpoint}/oidc/token")
{
   Content = new FormUrlEncodedContent(body)
};

has added a double slash after the endpoint, because the endpoint already ended with a slash which resulted in a 404 Not found rejecting the cookie.
I have refactored this and added a new method GetOidcTokenRequestUri to the LogtoCookieContextManager that will safely add "oidc/token" to the endpoint. I also added some test cases to test this method.

Testing

I added a new test file with test cases that test the GetOidcTokenRequestUri method.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

bug: Blazor Server setting a Resource will fail authentication
1 participant