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

Improve OpenIdConfiguration model #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

expuss2000
Copy link
Collaborator

No description provided.

@expuss2000 expuss2000 requested a review from jacogasp October 11, 2024 12:28
Copy link

@@ -9,7 +9,9 @@ export default async function GrantTypes(props: Readonly<GrantTypesProps>) {
const openIdConfiguration = await fetchOpenIdConfiguration();
const active_grant_types = props.grant_types ?? [];
const { grant_types_supported } = openIdConfiguration;
const grant_types = grant_types_supported.map(gt => {
const grant_types = (
grant_types_supported ?? ["authorization_code", "implicit"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With new client creation page we want to support only one grant type at the time, as mutual exclusive option.
Even though the grant types field is a list, it must be exactly one element long.

Copy link
Collaborator

@jacogasp jacogasp Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my fault, I thought it was related to the client creation but we are talking about the client editing/visualization.
I'm not sure if we want to add not one, but two fallback options in case the backend provides no supported grant type from the well known endpoint.
In any case, if I remember correctly, we don't want to support implicit credential
@giacomini @enricovianello

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're just the fallback values in case the list of grant_types_supported is not returned in the /.well-known/openid-configuration (actually I think IAM always returns it). The specifications says that in case of omission these are the default values. In case it's not wanted to support the implicit grant type, it's up to the backend to return the correct list in the .well-known.
Just to be clear, these fallback values are not actually used because IAM specify grant_types_supported, they are added just to make TypeScript happy.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that implicit must be removed from the well known (that's tautological), but still I do not understand why we want to hardcode the implicit fallback value if don't want to support it at all. Ok to make TypeScript happy, but I think it will be happy also without the implicit value :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be adhere to the specs. In case in the future a IAM deployment decides to use the default list of grant_types_supported and so does not explicit it in .well-known (this will probably never happen).

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

Successfully merging this pull request may close these issues.

2 participants