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

OIDC provider with OAM as OAuth server - Helidon treats scopes as string but is actually returned as Json array #5365

Closed
tjquinno opened this issue Nov 10, 2022 · 0 comments · Fixed by #5521
Assignees
Labels
3.x Issues for 3.x version branch bug Something isn't working P2 security
Milestone

Comments

@tjquinno
Copy link
Member

Environment Details

  • Helidon Version: 3.0.1
  • Helidon SE or Helidon MP
  • JDK version:
  • OS:
  • Docker version (if applicable):

Problem Description

We are using OIDC Provider of Helidon(3.0.1) with OAM (12.2.1.4) as OAuth server. OAM returns token that contain 'scopes' as array, where as Helidon is looking for string. We facing issues with Helidon's way of getting scopes from token in JWTUtils.toScopes(JsonObject json), as it always considers value as string.
Changing the implementation as below would resolve the issue:

return (json.get("scope") instanceof JsonArray) ? 
    		      getStrings(json, "scope") : 
    		          getString(json, "scope").<List<String>>map(it -> Arrays.asList(it.split(" ")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch bug Something isn't working P2 security
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants