Examples of OauthClientException


Examples of com.cloudbees.api.oauth.OauthClientException

    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

Examples of com.cloudbees.api.oauth.OauthClientException

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

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

Examples of com.cloudbees.api.oauth.OauthClientException

                params.put("scope", singletonList(join(Arrays.asList(scopes)," ")));

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

Examples of com.cloudbees.api.oauth.OauthClientException

            params.put("grant_type", singletonList("client_credentials"));
            params.put("scope", singletonList(join(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

Examples of com.cloudbees.api.oauth.OauthClientException

            params.put("scope", singletonList(join(tokenRequest.getScopes(), " ")));
            params.put("grant_type", singletonList("client_credentials"));

            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

Examples of com.cloudbees.api.oauth.OauthClientException

    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

Examples of com.cloudbees.api.oauth.OauthClientException

            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

Examples of com.cloudbees.api.oauth.OauthClientException

    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

Examples of com.cloudbees.api.oauth.OauthClientException

    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

Examples of com.cloudbees.api.oauth.OauthClientException

                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
TOP
Copyright © 2018 www.massapi.com. 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.