Class AccessTokenIssuer


  • public class AccessTokenIssuer
    extends Object
    Intended primarily to provide an easy interface to use in order to issue OAuth access tokens during attribute mapping using an Expression mapping type.

    An example OGNL Expression might look like this:
     #attrs =  new java.util.HashMap(),
     attrs.put("uid",#this.get("username")),
     attrs.put("email", #this.get("email")),
     #val = @com.pingidentity.sdk.oauth20.AccessTokenIssuer@issueToken(#attrs, null, null)
     
    The above will issue a new access token and return the opaque token value as the result of evaluating the expression. That value will be assigned as the attribute value for whatever field the expression is mapped into. In this example, the access token will have two attributes "uid" and "email". The values of those attributes are the values of the "username" and "email" attributes, respectively, from the attributes input into the mapping. The scope will be empty (default scope) and the client will be null.
    • Constructor Detail

      • AccessTokenIssuer

        public AccessTokenIssuer()
    • Method Detail

      • issueToken

        public static String issueToken​(Map<String,​Object> attributes,
                                        String scopeString,
                                        String clientId)
        Issues an access token and returns the String representation of the issued token. The token manager used to issue the access token is the default for the specified OAuth client, or the global default if the OAuth client has no default. Alternately, the access token manager ID can be directly specified using the second form of this method.
        Parameters:
        attributes - The attributes associated with this access token.
        scopeString - The scopes that will be assigned to the issued access token.
        clientId - The client ID of the issued access token.
        Returns:
        The String representation of the issued access token.
      • issueToken

        public static String issueToken​(Map<String,​Object> attributes,
                                        String scopeString,
                                        String clientId,
                                        String accessTokenManagerId)
        Issues an access token and returns the String representation of the issued token. The token manager used to issue the access token can be directly specified through the accessTokenManagerId parameter. If this parameter is null, then the default for the specified OAuth client is used, or the global default if the OAuth client has no default.
        Parameters:
        attributes - The attributes associated with this access token.
        scopeString - The scopes that will be assigned to the issued access token.
        clientId - The client ID of the issued access token.
        accessTokenManagerId - The ID of the access token manager to use in issuing the access token.
        Returns:
        The String representation of the issued access token.
      • issue

        public static IssuedAccessToken issue​(Map<String,​Object> attributes,
                                              String scopeString,
                                              String clientId)
        Issues an access token. The token manager used to issue the access token is the default for the specified OAuth client, or the global default if the OAuth client has no default. Alternately, the access token manager ID can be directly specified using the second form of this method.
        Parameters:
        attributes - The attributes associated with this access token.
        scopeString - The scopes that will be assigned to the issued access token.
        clientId - The client ID of the issued access token.
        Returns:
        The issued access token.
      • issue

        public static IssuedAccessToken issue​(Map<String,​Object> attributes,
                                              String scopeString,
                                              String clientId,
                                              String accessTokenManagerId)
        Issues an access token. The token manager used to issue the access token can be directly specified through the accessTokenManagerId parameter. If this parameter is null, then the default for the specified OAuth client is used, or the global default if the OAuth client has no default.
        Parameters:
        attributes - The attributes associated with this access token.
        scopeString - The scopes that will be assigned to the issued access token.
        clientId - The client ID of the issued access token.
        accessTokenManagerId - The ID of the access token manager to use in issuing the access token.
        Returns:
        The issued access token.
      • issue

        public static IssuedAccessToken issue​(Map<String,​Object> attributes,
                                              String scopeString,
                                              String clientId,
                                              String accessTokenManagerId,
                                              AuthorizationDetails authorizationDetails)
        Issues an access token. The token manager used to issue the access token can be directly specified through the accessTokenManagerId parameter. If this parameter is null, then the default for the specified OAuth client is used, or the global default if the OAuth client has no default.
        Parameters:
        attributes - The attributes associated with this access token.
        scopeString - The scopes that will be assigned to the issued access token.
        clientId - The client ID of the issued access token.
        accessTokenManagerId - The ID of the access token manager to use in issuing the access token.
        authorizationDetails - The authorization details that will be assigned to the issued access token.
        Returns:
        The issued access token.
        Since:
        11.2