com.covisint.platform.oauth.client.token.sdk.SwappableCredentialSupport Maven / Gradle / Ivy
/*
* Copyright 2015 Covisint
*
* 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.covisint.platform.oauth.client.token.sdk;
import com.covisint.core.support.constraint.Nonnull;
import com.covisint.core.support.constraint.NotEmpty;
import com.covisint.core.support.constraint.Nullable;
/**
* Interface providing support for swapping out client id/secret credentials, used in a given {@link TokenSupplier}.
* This allows implementors to move from app-level to person-level access tokens on demand, by simply calling
* {@link #swapCredentials(String, String, String)}.
*/
public interface SwappableCredentialSupport {
/**
* Swap the current credentials with the given ones, optionally supplying the associated application id.
*
* @param clientId The client id.
* @param clientSecret The client secret.
* @param applicationId The application id.
*/
void swapCredentials(@Nonnull @NotEmpty String clientId, @Nonnull @NotEmpty String clientSecret,
@Nullable String applicationId);
}