public String prepareUrl ( List < Scope > scopes , String redirectUri , String csrfToken ) throws InvalidRequestException { logger . debug ( "Enter OAuth2config::prepareUrl" ) ; if ( scopes == null || scopes . isEmpty ( ) || redirectUri . isEmpty ( ) || csrfToken . isEmpty ( ) ) { logger . error ( "Invalid request for prepareUrl " ) ; throw new InvalidRequestException ( "Invalid request for prepareUrl" ) ; } try { return intuitAuthorizationEndpoint + "?client_id=" + clientId + "&response_type=code&scope=" + URLEncoder . encode ( buildScopeString ( scopes ) , "UTF-8" ) + "&redirect_uri=" + URLEncoder . encode ( redirectUri , "UTF-8" ) + "&state=" + csrfToken ; } catch ( UnsupportedEncodingException e ) { logger . error ( "Exception while preparing url for redirect " , e ) ; throw new InvalidRequestException ( e . getMessage ( ) , e ) ; } }
Prepares URL to call the OAuth2 authorization endpoint using Scope CSRF and redirectURL that is supplied