public String getAuthorizationUri ( final String redirectUri , final Set < String > scopes , final String state ) { if ( account == null ) throw new IllegalArgumentException ( "Auth is not set" ) ; if ( account . getClientId ( ) == null ) throw new IllegalArgumentException ( "client_id is not set" ) ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( URI_AUTHENTICATION ) ; builder . append ( "?" ) ; builder . append ( "response_type=" ) ; builder . append ( encode ( "code" ) ) ; builder . append ( "&redirect_uri=" ) ; builder . append ( encode ( redirectUri ) ) ; builder . append ( "&client_id=" ) ; builder . append ( encode ( account . getClientId ( ) ) ) ; builder . append ( "&scope=" ) ; builder . append ( encode ( getScopesString ( scopes ) ) ) ; builder . append ( "&state=" ) ; builder . append ( encode ( state ) ) ; builder . append ( "&code_challenge" ) ; builder . append ( getCodeChallenge ( ) ) ; // Already url encoded builder . append ( "&code_challenge_method=" ) ; builder . append ( encode ( "S256" ) ) ; return builder . toString ( ) ; }
Get the authorization uri where the user logs in .