com.stormpath.sdk.oauth.OauthPolicy Maven / Gradle / Ivy
/*
* Copyright 2015 Stormpath, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stormpath.sdk.oauth;
import com.stormpath.sdk.application.Application;
import com.stormpath.sdk.resource.Resource;
import com.stormpath.sdk.resource.Saveable;
import com.stormpath.sdk.tenant.Tenant;
/**
* An OauthPolicy resource is used to configure different aspects of the OAuth tokens associated
* with an {@link Application Application}
*
* @since 1.0.RC7
*/
public interface OauthPolicy extends Resource, Saveable {
/**
* Returns the Time To Live for the tokens created for the parent {@link Application Application} expressed in a period of time format, for example: PT1H.
*
* @return the String representation of the Time To Live for the tokens created for the parent {@link Application Application}
*/
String getAccessTokenTtl();
/**
* Returns the Time To Live for the refresh tokens created for the parent {@link Application Application} expressed in a period of time format, for example: PT1H.
*
* @return the String representation of the Time To Live for the refresh tokens created for the parent {@link Application Application}
*/
String getRefreshTokenTtl();
/**
* The href corresponding to the Endpoint for Access Tokens created for the parent {@link Application Application}
*
* @return the href corresponding to the Token Endpoint for Access Tokens created for the parent {@link Application Application}
*/
String getTokenEndpoint();
/**
* Sets the Time To Live for the tokens created for the parent {@link Application Application} expressed in a period of time format, for example: PT1H.
*
* @return this instance for method chaining.
*/
OauthPolicy setAccessTokenTtl(String accessTokenTtl);
/**
* Sets the Time To Live for the refresh tokens created for the parent {@link Application Application} expressed in a period of time format, for example: PT1H.
* Since Refresh tokens are optional, if you would like to disable the refresh token from being generated, set a zero duration value (PT0M, PT0S, etc).
*
* @return this instance for method chaining.
*/
OauthPolicy setRefreshTokenTtl(String refreshTokenTtl);
/**
* Returns the {@link Application Application} associated to this {@link OauthPolicy OauthPolicy}
*
* @return the {@link Application Application} associated to this {@link OauthPolicy OauthPolicy}
*/
Application getApplication();
/**
* Returns the parent {@link Tenant Tenant} of the {@link Application Application} associated to this {@link OauthPolicy OauthPolicy}
*
* @return the parent {@link Tenant Tenant} of the {@link Application Application} associated to this {@link OauthPolicy OauthPolicy}
*/
Tenant getTenant();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy