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

br.com.jhonsapp.bootstrap.authentication.security.authentication.clientAPI.SecurityClientImpl Maven / Gradle / Ivy

package br.com.jhonsapp.bootstrap.authentication.security.authentication.clientAPI;

public class SecurityClientImpl implements SecurityClient {

	private String client;
	private String secret;
	private String[] scopes;
	private String[] grantTypes;
	private int accessTokenValidity;
	private int refreshTokenValidity;
	
	
	public SecurityClientImpl(String client, String secret, String[] scopes, String[] grantTypes, int accessTokenValidity,
			int refreshTokenValidity) {
		super();
		this.client = client;
		this.secret = secret;
		this.scopes = scopes;
		this.grantTypes = grantTypes;
		this.accessTokenValidity = accessTokenValidity;
		this.refreshTokenValidity = refreshTokenValidity;
	}
	
	public SecurityClientImpl(String client, String secret) {
		super();
		this.client = client;
		this.secret = secret;
		this.scopes = new String[]{"read", "write"};
		this.grantTypes = new String[]{"password", "refresh_token"};
		this.accessTokenValidity = 1800;
		this.refreshTokenValidity = 3600 * 24;
	}


	@Override
	public String getClient() {
		return client;
	}

	@Override
	public String getSecret() {
		return secret;
	}

	@Override
	public String[] getScopes() {
		return scopes;
	}

	@Override
	public String[] getGrantTypes() {
		return grantTypes;
	}

	@Override
	public int getAccessTokenValidity() {
		return accessTokenValidity;
	}

	@Override
	public int getRefreshTokenValidity() {
		return refreshTokenValidity;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy