oidc icon indicating copy to clipboard operation
oidc copied to clipboard

fix(op): add scope to access token scope

Open isegura-eos-eng opened this issue 1 year ago • 0 comments

This attempts to solve Issue 660.

All the details are there. TLDR; Access Token response is not compliant with OAuth 2.0. We decided to always return the scope property in the Access Token response to comply with RFC 6749.

The implementation consists of getting the scope from the token request, which should be already containing only the scopes that are granted.

Definition of Ready

  • [ ] I am happy with the code
  • [x] Short description of the feature/issue is added in the pr description
  • [x] PR is linked to the corresponding user story
  • [ ] Acceptance criteria are met
  • [ ] All open todos and follow ups are defined in a new ticket and justified
  • [ ] Deviations from the acceptance criteria and design are agreed with the PO and documented.
  • [ ] No debug or dead code
  • [ ] My code has no repetitions
  • [ ] Critical parts are tested automatically
  • [ ] Where possible E2E tests are implemented
  • [ ] Documentation/examples are up-to-date
  • [ ] All non-functional requirements are met
  • [ ] Functionality of the acceptance criteria is checked manually on the dev system.

Further improvements

In my opinion, a more elegant solution would be to strictly adhere with the protocol and only return the scope if has been modified from the request. If compliant, clients could assume all scopes are given by the absence of the scope property in the token response, this would avoid parsing the response scope. However, this change would probably cause a breaking change in the exported package, so this solution is good for now.

isegura-eos-eng avatar Oct 09 '24 16:10 isegura-eos-eng