From 9b61eba41d0d7b4c77394ad3d292b22935509a2a Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Thu, 21 Sep 2017 10:19:28 -0400 Subject: [PATCH] Add identifier strategy for ClientRegistration Fixes gh-4561 --- .../ClientRegistrationIdentifierStrategy.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationIdentifierStrategy.java diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationIdentifierStrategy.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationIdentifierStrategy.java new file mode 100644 index 0000000000..4d8d7708cc --- /dev/null +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationIdentifierStrategy.java @@ -0,0 +1,29 @@ +/* + * Copyright 2012-2017 the original author or authors. + * + * 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 org.springframework.security.oauth2.client.registration; + +/** + * A strategy for obtaining a unique identifier for a {@link ClientRegistration}. + * + * @author Joe Grandja + * @since 5.0 + * @see ClientRegistration + */ +public interface ClientRegistrationIdentifierStrategy { + + T getIdentifier(ClientRegistration clientRegistration); + +}