Package com.cloudbees.api.oauth

Examples of com.cloudbees.api.oauth.OauthClientException


            params.put("grant_type", singletonList("client_credentials"));
            params.put("scope", new ArrayList<String>(scopes));

            return bees.formUrlEncoded(gcUrl+"/oauth/token", null, params).bind(OauthToken.class,bees);
        } catch (IOException e) {
            throw new OauthClientException("Failed to create OAuth token from OAuth client ID&secret",e);
        }
    }
View Full Code Here


    public OauthToken createToken(TokenRequest tokenRequest) throws OauthClientException {
        try{
            OauthTokenDetail resp = bees.jsonPOJORequest(gcUrl + "/api/v2/authorizations", tokenRequest, OauthTokenDetail.class, "POST");
            return toToken(resp);
        }catch(IOException e){
            throw new OauthClientException("Failed to validate token. "+e.getMessage(), e);
        }
    }
View Full Code Here

            for (OauthTokenDetail d : rsp.authorized_tokens) {
                d.owner = this;
            }
            return rsp.authorized_tokens;
        } catch(IOException e) {
            throw new OauthClientException("Failed to list up tokens. "+e.getMessage(), e);
        }
    }
View Full Code Here

    public void deleteToken(String oauthTokenId) throws OauthClientException {
        try {
            bees.jsonPOJORequest(gcUrl + "/api/v2/authorizations/"+oauthTokenId, null, null, "DELETE");
        } catch (IOException e) {
            throw new OauthClientException("Failed to delete OAuth token",e);
        }
    }
View Full Code Here

    public void deleteApplication(String clientId) throws OauthClientException {
        try {
            bees.jsonPOJORequest(gcUrl + "/api/v2/applications/"+clientId, null, null, "DELETE");
        } catch (IOException e) {
            throw new OauthClientException("Failed to delete OAuth application",e);
        }
    }
View Full Code Here

                params.put("redirect_uri", singletonList(redirectUri));

            OauthTokenDetail resp = bees.formUrlEncoded(gcUrl+"/oauth/token", null, params).bind(OauthTokenDetail.class,bees);
            return toToken(resp);
        } catch (IOException e) {
            throw new OauthClientException("Failed to exchange authorization code to access token",e);
        }
    }
View Full Code Here

            params.put("grant_type", singletonList("client_credentials"));
            params.put("scope", new ArrayList<String>(scopes));

            return bees.formUrlEncoded(gcUrl+"/oauth/token", null, params).bind(OauthToken.class,bees);
        } catch (IOException e) {
            throw new OauthClientException("Failed to create OAuth token from OAuth client ID&secret",e);
        }
    }
View Full Code Here

    public OauthToken createToken(TokenRequest tokenRequest) throws OauthClientException {
        try{
            OauthTokenDetail resp = bees.jsonPOJORequest(gcUrl + "/api/v2/authorizations", tokenRequest, OauthTokenDetail.class, "POST");
            return toToken(resp);
        }catch(IOException e){
            throw new OauthClientException("Failed to create token. "+e.getMessage(), e);
        }
    }
View Full Code Here

            for (OauthTokenDetail d : rsp.authorized_tokens) {
                d.owner = this;
            }
            return rsp.authorized_tokens;
        } catch(IOException e) {
            throw new OauthClientException("Failed to list up tokens. "+e.getMessage(), e);
        }
    }
View Full Code Here

    public void deleteToken(String oauthTokenId) throws OauthClientException {
        try {
            bees.jsonPOJORequest(gcUrl + "/api/v2/authorizations/"+oauthTokenId, null, null, "DELETE");
        } catch (IOException e) {
            throw new OauthClientException("Failed to delete OAuth token",e);
        }
    }
View Full Code Here

TOP

Related Classes of com.cloudbees.api.oauth.OauthClientException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.