fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/auth0/Auth0Client.java
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()));
    }
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()));
    }
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.

@param clientIdParam The client id.
@param clientSecretParam The client secret.
@param codeParam The code.
@param redirectUrlParam The redirect URL after successful authentication.

@return Access Token.

@see AccessToken
Gets a Access Token from Auth0 .