Java Code Examples for org.apache.oltu.oauth2.client.request.OAuthClientRequest#authorizationLocation()

The following examples show how to use org.apache.oltu.oauth2.client.request.OAuthClientRequest#authorizationLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OAuth.java    From openapi-generator with Apache License 2.0 6 votes vote down vote up
public OAuth(Client client, OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) {
    this(client, OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes));

    switch(flow) {
    case accessCode:
    case implicit:
        tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE);
        break;
    case password:
        tokenRequestBuilder.setGrantType(GrantType.PASSWORD);
        break;
    case application:
        tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS);
        break;
    default:
        break;
    }
    authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl);
}
 
Example 2
Source File: OAuth.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) {
    this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes));
    setFlow(flow);
    authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl);
}
 
Example 3
Source File: OAuth.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) {
    this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes));
    setFlow(flow);
    authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl);
}
 
Example 4
Source File: OAuth.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) {
    this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes));
    setFlow(flow);
    authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl);
}
 
Example 5
Source File: OAuth.java    From android with MIT License 4 votes vote down vote up
public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) {
    this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes));
    setFlow(flow);
    authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl);
}