All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartbear.readyapi.client.auth.OAuth2AuthenticationBuilder Maven / Gradle / Ivy

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

There is a newer version: 1.2.1
Show newest version
package com.smartbear.readyapi.client.auth;

import com.smartbear.readyapi.client.model.Authentication;

public class OAuth2AuthenticationBuilder implements AuthenticationBuilder {

    protected Authentication authentication = new Authentication();

    public OAuth2AuthenticationBuilder withAccessToken(String accessToken) {
        authentication.setAccessToken(accessToken);
        return this;
    }

    public OAuth2AuthenticationBuilder withAccessTokenUri(String accessTokenUri) {
        authentication.setAccessTokenUri(accessTokenUri);
        return this;
    }

    public OAuth2AuthenticationBuilder withAccessTokenPosition(String accessTokenPosition) {
        authentication.setAccessTokenPosition(accessTokenPosition);
        return this;
    }

    public OAuth2AuthenticationBuilder withClientId(String clientId) {
        authentication.setClientId(clientId);
        return this;
    }

    public OAuth2AuthenticationBuilder withClientSecret(String clientSecret) {
        authentication.setClientSecret(clientSecret);
        return this;
    }

    public OAuth2AuthenticationBuilder withRefreshToken(String refreshToken) {
        authentication.setRefreshToken(refreshToken);
        return this;
    }

    @Override
    public Authentication build() {
        authentication.setType("OAuth 2.0");
        return authentication;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy