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

Authentication docs could do with a note around .NET 8 changes #1876

Open
devsbryan opened this issue Jan 5, 2024 · 11 comments · May be fixed by #2238
Open

Authentication docs could do with a note around .NET 8 changes #1876

devsbryan opened this issue Jan 5, 2024 · 11 comments · May be fixed by #2238
Assignees
Labels
Authentication Ocelot feature: Authentication bug Identified as a potential bug documentation Needs a documentation update good first issue Should be pretty easy to do help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort NET9 .NET 9 release small effort Likely less than a day of development effort.
Milestone

Comments

@devsbryan
Copy link

devsbryan commented Jan 5, 2024

Docs Update Suggestion

The section in the authentication docs that deals with overriding the mapping of the scp claim no longer applies in .net 8.

The JwtSecurityTokenHandler is no longer the default, and has been replaced by JsonWebTokenHandler

The example in the docs will work in .net 8 by simply replacing the reference to the JwtSecurityTokenHandler.

i.e.

JsonWebTokenHandler.DefaultInboundClaimTypeMap.Remove("scp");
JsonWebTokenHandler.DefaultInboundClaimTypeMap.Add("scp", "scope");

It is perhaps also worth mentioning in the docs that this does not solely apply to using Okta (in my case it also applies to Azure AD)

References:

Motivation for New Feature

  1. Avoid confusion for anyone attempting to configure Ocelot authentication on .NET 8.
  2. Without this change, scopes do not work.

Steps to Reproduce the Problem

n/a

Specifications

n/a

@raman-m raman-m added bug Identified as a potential bug documentation Needs a documentation update labels Jan 5, 2024
@raman-m
Copy link
Member

raman-m commented Jan 5, 2024

Hi Bryan!
Welcome to Ocelot world! 🐯

Thanks for reporting this issue and letting us know about these changes in claims mapping!
Will you contribute to update the docs?

Ideally, this issue ticket can be closed by a PR with acceptance tests or develop a sample to merge.
Writing acceptance tests is not easy.
Create a sample is a bit easier.
But I believe simple updating of our docs will be fine too.

Do you have an intention to work on this issue being created by you?

@raman-m raman-m changed the title Authentication docs could do with a note around .net 8 changes Authentication docs could do with a note around .NET 8 changes Jan 5, 2024
@raman-m raman-m added the Oct'24 October 2024 release label Jun 16, 2024
@raman-m raman-m added this to the Summer'24 milestone Jun 16, 2024
@raman-m raman-m added Dec'24 December 2024 release and removed Oct'24 October 2024 release labels Oct 26, 2024
@raman-m raman-m modified the milestones: October'24, Autumn'24 Oct 26, 2024
@raman-m raman-m added help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort small effort Likely less than a day of development effort. labels Oct 26, 2024
@raman-m raman-m pinned this issue Oct 26, 2024
@raman-m
Copy link
Member

raman-m commented Nov 24, 2024

@devsbryan Could you help us to upgrade docs plz?

@raman-m raman-m added good first issue Should be pretty easy to do and removed Dec'24 December 2024 release labels Nov 24, 2024
@raman-m raman-m modified the milestones: Autumn'24, .NET 9 Nov 24, 2024
@raman-m raman-m unpinned this issue Nov 28, 2024
@jvanderlei
Copy link

jvanderlei commented Dec 12, 2024

@raman-m Can I do it?

I would first update the docs, then develop a sample as you suggested earlier

@raman-m raman-m added the NET9 .NET 9 release label Dec 12, 2024
@raman-m
Copy link
Member

raman-m commented Dec 13, 2024

@jvanderlei Welcome! You are assigned!

To start development please fork the repository to your account! Currently I don't see Ocelot repo in your account repos.
Also please refer to our Dev Process.

@raman-m
Copy link
Member

raman-m commented Dec 13, 2024

Please be aware that we have a strict deadline to complete the .NET 9 milestone tasks. How soon can you open a pull request?

@jvanderlei
Copy link

I'll send the PR for the documentation today, I'm now just reading the details on the breaking changes.

@jvanderlei jvanderlei linked a pull request Dec 13, 2024 that will close this issue
@raman-m raman-m added the Authentication Ocelot feature: Authentication label Dec 14, 2024
@raman-m
Copy link
Member

raman-m commented Dec 14, 2024

@devsbryan Hello, Simon! Are you online?

@raman-m
Copy link
Member

raman-m commented Dec 14, 2024

Motivation for New Feature

  1. Avoid confusion for anyone attempting to configure Ocelot authentication on .NET 8.
  2. Without this change, scopes do not work.

@jvanderlei Please note that the issue has been marked with a label: bug label. Therefore it would be advisable to write actual unit & acceptance tests to demonstrate the issue. Please include them in the current open PR.
However I have a concern: does Okta Auth provide a sandbox environment for testing and development purposes? How do you utilize Okta?

@jvanderlei
Copy link

@raman-m All right. I'm not the most versed dev on acceptance testing, but I'll try my best to deliver it until tomorrow.
And yes, Okta Auth0 provides a development enviroment when you register a new app on them. I'm developing a personal project as a angular SPA and .Net backend

@raman-m
Copy link
Member

raman-m commented Dec 14, 2024

@jvanderlei wrote:

Please don't rush! Please relax this weekend. You may return to writing tests on Monday.
FYI, we have a dedicated project for tests: Ocelot.AcceptanceTests. Specifically, the tests should be placed in: AuthenticationTests. However, you may create a OktaAuthenticationTests class.

And yes, Okta Auth0 provides a development environment when you register a new app on them. I'm developing a personal project as a angular SPA and .Net backend

Very well. Could you help us register an Ocelot native account for testing from both local and CircleCI environments? We need your instructions on that...

@jvanderlei
Copy link

Perfect. And yes, I can. I'll look some more about the registering for CI pipeline, and return to you about this process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authentication Ocelot feature: Authentication bug Identified as a potential bug documentation Needs a documentation update good first issue Should be pretty easy to do help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort NET9 .NET 9 release small effort Likely less than a day of development effort.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants