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

Update JWT Auth validate to have access to request context #375

Closed
maarek opened this issue Apr 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@maarek
Copy link

commented Apr 2, 2018

JWT Authentication validate() configure should receive AuthenticationContext as a receiver so that the validation function can have access to the request and be able to validate claims against the request.

install(Authentication) {
  jwt("jwt") {
    validate { credential ->
      val claim: Claim = credential.payload.getClaim("scopes")
      when {
        // validate claim against request parameters
        else -> null
      }
   }
}

cy6erGn0m added a commit that referenced this issue Apr 16, 2018

cy6erGn0m added a commit that referenced this issue Apr 16, 2018

@cy6erGn0m cy6erGn0m closed this in 95888b6 Apr 18, 2018

schleinzer pushed a commit to schleinzer/ktor that referenced this issue Feb 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.