Class JWTAccessTokenBuilder

  • All Implemented Interfaces:
    org.wso2.carbon.identity.oauth2.token.OauthTokenIssuer

    public class JWTAccessTokenBuilder
    extends org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl
    JWTAccessTokenBuilder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String accessToken​(org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext oAuthAuthzReqMessageContext)  
      java.lang.String accessToken​(org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext oAuthTokenReqMessageContext)  
      protected java.lang.String buildIDToken​(org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext request)
      Build a signed jwt token from authorization request message context
      protected java.lang.String buildIDToken​(org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext request)
      To build id token from OauthToken request message context
      protected com.nimbusds.jose.JWSAlgorithm mapSignatureAlgorithm​(java.lang.String signatureAlgorithm)
      This method map signature algorithm define in identity.xml to nimbus signature algorithm format, Strings are defined inline hence there are not being used any where
      protected java.lang.String signJWT​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet, org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext request)  
      protected java.lang.String signJWT​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet, org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext request)
      Generic Signing function
      protected java.lang.String signJWTWithRSA​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet, org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext request)  
      protected java.lang.String signJWTWithRSA​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet, org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext request)
      sign JWT token from RSA algorithm
      • Methods inherited from class org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl

        authorizationCode, refreshToken, refreshToken
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JWTAccessTokenBuilder

        public JWTAccessTokenBuilder()
                              throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
    • Method Detail

      • accessToken

        public java.lang.String accessToken​(org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext oAuthTokenReqMessageContext)
                                     throws org.apache.oltu.oauth2.common.exception.OAuthSystemException
        Specified by:
        accessToken in interface org.wso2.carbon.identity.oauth2.token.OauthTokenIssuer
        Overrides:
        accessToken in class org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl
        Throws:
        org.apache.oltu.oauth2.common.exception.OAuthSystemException
      • accessToken

        public java.lang.String accessToken​(org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext oAuthAuthzReqMessageContext)
                                     throws org.apache.oltu.oauth2.common.exception.OAuthSystemException
        Specified by:
        accessToken in interface org.wso2.carbon.identity.oauth2.token.OauthTokenIssuer
        Overrides:
        accessToken in class org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl
        Throws:
        org.apache.oltu.oauth2.common.exception.OAuthSystemException
      • buildIDToken

        protected java.lang.String buildIDToken​(org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext request)
                                         throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        To build id token from OauthToken request message context
        Parameters:
        request - Token request message context
        Returns:
        Signed jwt string.
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
      • buildIDToken

        protected java.lang.String buildIDToken​(org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext request)
                                         throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        Build a signed jwt token from authorization request message context
        Parameters:
        request - Oauth authorization message context
        Returns:
        Signed jwt string
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
      • signJWTWithRSA

        protected java.lang.String signJWTWithRSA​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet,
                                                  org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext request)
                                           throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        sign JWT token from RSA algorithm
        Parameters:
        jwtClaimsSet - contains JWT body
        request -
        Returns:
        signed JWT token
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
      • signJWTWithRSA

        protected java.lang.String signJWTWithRSA​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet,
                                                  org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext request)
                                           throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
      • signJWT

        protected java.lang.String signJWT​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet,
                                           org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext request)
                                    throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        Generic Signing function
        Parameters:
        jwtClaimsSet - contains JWT body
        request -
        Returns:
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
      • signJWT

        protected java.lang.String signJWT​(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet,
                                           org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext request)
                                    throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
      • mapSignatureAlgorithm

        protected com.nimbusds.jose.JWSAlgorithm mapSignatureAlgorithm​(java.lang.String signatureAlgorithm)
                                                                throws org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception
        This method map signature algorithm define in identity.xml to nimbus signature algorithm format, Strings are defined inline hence there are not being used any where
        Parameters:
        signatureAlgorithm -
        Returns:
        Throws:
        org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception