|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright 2002-2017 the original author or authors.
|
|
|
+ * Copyright 2002-2019 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.
|
|
@@ -15,12 +15,8 @@
|
|
|
*/
|
|
|
package org.springframework.security.oauth2.core.user;
|
|
|
|
|
|
-import org.springframework.security.core.AuthenticatedPrincipal;
|
|
|
import org.springframework.security.core.Authentication;
|
|
|
-import org.springframework.security.core.GrantedAuthority;
|
|
|
-
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Map;
|
|
|
+import org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal;
|
|
|
|
|
|
/**
|
|
|
* A representation of a user {@code Principal}
|
|
@@ -37,29 +33,16 @@ import java.util.Map;
|
|
|
* Please consult the provider's API documentation for the set of supported user attribute names.
|
|
|
*
|
|
|
* <p>
|
|
|
- * Implementation instances of this interface represent an {@link AuthenticatedPrincipal}
|
|
|
+ * Implementation instances of this interface represent an {@link OAuth2AuthenticatedPrincipal}
|
|
|
* which is associated to an {@link Authentication} object
|
|
|
* and may be accessed via {@link Authentication#getPrincipal()}.
|
|
|
*
|
|
|
* @author Joe Grandja
|
|
|
+ * @author Eddú Meléndez
|
|
|
* @since 5.0
|
|
|
* @see DefaultOAuth2User
|
|
|
- * @see AuthenticatedPrincipal
|
|
|
+ * @see OAuth2AuthenticatedPrincipal
|
|
|
*/
|
|
|
-public interface OAuth2User extends AuthenticatedPrincipal {
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns the authorities granted to the user.
|
|
|
- *
|
|
|
- * @return a {@code Collection} of {@link GrantedAuthority}(s)
|
|
|
- */
|
|
|
- Collection<? extends GrantedAuthority> getAuthorities();
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns the attributes about the user.
|
|
|
- *
|
|
|
- * @return a {@code Map} of attributes about the user
|
|
|
- */
|
|
|
- Map<String, Object> getAttributes();
|
|
|
+public interface OAuth2User extends OAuth2AuthenticatedPrincipal {
|
|
|
|
|
|
}
|