lib/rodauth/features/oauth_jwt.rb in rodauth-oauth-1.3.2 vs lib/rodauth/features/oauth_jwt.rb in rodauth-oauth-1.4.0

- old
+ new

@@ -7,11 +7,11 @@ Feature.define(:oauth_jwt, :OauthJwt) do depends :oauth_jwt_base, :oauth_jwt_jwks auth_value_method :oauth_jwt_access_tokens, true - auth_value_methods(:jwt_claims) + auth_methods(:jwt_claims) def require_oauth_authorization(*scopes) return super unless oauth_jwt_access_tokens authorization_required unless authorization_token @@ -97,11 +97,11 @@ jwt_encode(claims) end def _generate_access_token(*) - return super unless oauth_jwt_access_tokens + super unless oauth_jwt_access_tokens end def jwt_claims(oauth_grant) issued_at = Time.now.to_i @@ -115,10 +115,10 @@ # SHOULD correspond to the subject identifier of the resource owner. # In case of access tokens obtained through grants where no resource # owner is involved, such as the client credentials grant, the value # of "sub" SHOULD correspond to an identifier the authorization # server uses to indicate the client application. - sub: jwt_subject(oauth_grant), + sub: jwt_subject(oauth_grant[oauth_grants_account_id_column]), client_id: oauth_application[oauth_applications_client_id_column], exp: issued_at + oauth_access_token_expires_in, aud: oauth_jwt_audience }