Class Authentication


  • public class Authentication
    extends Object
    Functions for handling authentication.
    • Method Detail

      • authorizeOAuth2V30

        public void authorizeOAuth2V30​(String client_id,
                                       String redirect_uri,
                                       String response_type)
        Get authorization code. This method is used as part of authenticating using the OAuth2 protocol. This method redirect the call to the signin page.
        Parameters:
        client_id - The identifier for the application making the request.
        redirect_uri - A URL where an application where an application should be redirected after a users has successfully been authenticated.
        response_type - An OAuth Response Type. It should be set to "code".
      • getAuthenticationParametersV30

        public AuthenticationParametersJson getAuthenticationParametersV30​(String clientId,
                                                                           String userEmail)
        Gets the method used to authenticate the user session, whether with the BlackBerry Workspaces servers or with an oauth2 server.
        Parameters:
        clientId - Identifier for the client application to fetch parameters for. If no value is provide
        userEmail - Email address of the user to fetch the Authentication parameters for. If no value is provided returns the parameters for the organization.
        Returns:
        A JSON object containing the authentication methods supported and URIs for the authorization and primary server.
      • getOIDCPublicKeyV30

        public OidcPublicKeyResultJson getOIDCPublicKeyV30()
        Account Registration status
        Returns:
        A string representing the OIDC public key in JWK format
      • getOrRefreshAccessTokenByPostV30

        public GetOrRefreshAccessTokenResponseJson getOrRefreshAccessTokenByPostV30​(String client_id,
                                                                                    String client_secret,
                                                                                    String code,
                                                                                    String grant_type,
                                                                                    String redirect_uri,
                                                                                    String refresh_token,
                                                                                    Set<String> scope)
        Gets or refreshes an Access token by using POST. This method is used as part of authenticating using the OAuth2 protocol. After initially authenticating a a user, this method can be used to obtain an Access token and a Refresh token using the "code" returned on the redirect URL. If an application had previously retrieved an Access token and Refresh token, and the Access token expires, this method can be used to obtain a fresh set of tokens by passing the Refresh token obtained previously.
        Parameters:
        client_id - The identifier for the application making the request.
        client_secret - The client secret or password created for the application identified by client_id.
        code - The code provided on the redirected URL after authentication. The code is only used when getting an Access Token, not when refreshing a token.
        grant_type - An OAuth Grant Type. Currently only "authorization_code" and "refresh_token" are supported. "authorization_code" should be used when making a request to authenticate a user and get a new Access Token. "refresh_token" is used when refreshing an Access Token after the current token has expired.
        redirect_uri - A URL where an application where an application should be redirected after a users has successfully been authenticated.
        refresh_token - A Refresh Token previously obtained from the server after authenticating a user. The Refresh Token is used to obtain a new Access Token and Refresh Token after an existing Access Token has expired.
        scope - Not currently used.
        Returns:
        GetOrRefreshAccessTokenResponseJson
      • getOrRefreshAccessTokenV30

        public GetOrRefreshAccessTokenResponseJson getOrRefreshAccessTokenV30​(String client_id,
                                                                              String client_secret,
                                                                              String code,
                                                                              String grant_type,
                                                                              String redirect_uri,
                                                                              String refresh_token,
                                                                              Set<String> scope)
        Get or refresh an Access token. This method is used as part of authenticating using the OAuth2 protocol. After initially authenticating a a user, this method can be used to obtain an Access token and a Refresh token using the "code" returned on the redirect URL. If an application had previously retrieved an Access token and Refresh token, and the Access token expires, this method can be used to obtain a fresh set of tokens by passing the Refresh token obtained previously.
        Parameters:
        client_id - The identifier for the application making the request.
        client_secret - The client secret or password created for the application identified by client_id.
        code - The code provided on the redirected URL after authentication. The code is only used when getting an Access Token, not when refreshing a token.
        grant_type - An OAuth Grant Type. Currently only "authorization_code" and "refresh_token" are supported. "authorization_code" should be used when making a request to authenticate a user and get a new Access Token. "refresh_token" is used when refreshing an Access Token after the current token has expired.
        redirect_uri - A URL where an application where an application should be redirected after a users has successfully been authenticated.
        refresh_token - A Refresh Token previously obtained from the server after authenticating a user. The Refresh Token is used to obtain a new Access Token and Refresh Token after an existing Access Token has expired.
        scope - Not currently used.
        Returns:
        GetOrRefreshAccessTokenResponseJson
      • getUsernamePasswordAccountCreationStatusV30

        public AccountCreationStatusResultJson getUsernamePasswordAccountCreationStatusV30​(AccountCreationStatusRequestJson accountCreationStatusRequestJson)
        Account Registration status
        Parameters:
        accountCreationStatusRequestJson -
        Returns:
        AccountCreationStatusResultJson