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

Clarification needed for addScope method: Avoid duplicate "openid" scope #424

Open
LaurentNoyon opened this issue Aug 9, 2024 · 1 comment

Comments

@LaurentNoyon
Copy link

Problem:

I encountered an issue with the addScope method when using it to add scopes to an OpenID connection. I think that the current implementation of addScope lacks of clarity around the fact that the "openid" scope is already included by default.

In my case I unintentionally duplicated the "openid" scope by calling addScope(["openid"]), which resulted in the "openid" scope being duplicated in the final list of scopes.

Code incriminated :

if (count($this->scopes) > 0) {
    $auth_params = array_merge($auth_params, ['scope' => implode(' ', array_merge($this->scopes, ['openid']))]);
}

Suggestions:

  • Warning message: Implement a warning message that informs developers when they attempt to add the "openid" scope, indicating that this scope is already included by default.

  • Automatic handling: Alternatively, the addScope method could automatically ignore the addition of the "openid" scope via addScope method, thus preventing duplication.

Thank you for considering this enhancement.

@DeepDiver1975
Copy link
Collaborator

scopes should be treating internally as unique array .... pr welcome ...

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

No branches or pull requests

2 participants