public AccessToken getAccessToken ( String clientIdParam , String clientSecretParam , String codeParam , String redirectUrlParam ) { if ( clientIdParam == null || clientIdParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Client Id must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( clientSecretParam == null || clientSecretParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Client Secret must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( codeParam == null || codeParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Code must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } AccessTokenRequest tokenRequest = new AccessTokenRequest ( ) ; tokenRequest . setClientId ( clientIdParam ) ; tokenRequest . setClientSecret ( clientSecretParam ) ; tokenRequest . setGrantType ( AUTHORIZATION_CODE ) ; tokenRequest . setCode ( codeParam ) ; tokenRequest . setRedirectUri ( redirectUrlParam ) ; return new AccessToken ( this . postJson ( false , tokenRequest , WS . Path . Auth0 . Version1 . userToken ( ) ) ) ; }
Gets a Access Token from Auth0 .