private void invokeTokenRequest ( String grantCode ) { AuthorizationRequestManager . RequestOptions options = new AuthorizationRequestManager . RequestOptions ( ) ; options . parameters = createTokenRequestParams ( grantCode ) ; options . headers = createTokenRequestHeaders ( grantCode ) ; addSessionIdHeader ( options . headers ) ; options . requestMethod = Request . POST ; InnerAuthorizationResponseListener listener = new InnerAuthorizationResponseListener ( ) { @ Override public void handleAuthorizationSuccessResponse ( Response response ) throws Exception { saveTokenFromResponse ( response ) ; handleAuthorizationSuccess ( response ) ; } } ; authorizationRequestSend ( null , "token" , options , listener ) ; }
Invoke request to get token the result of the response should be a valid token