diff --git a/samples/boot/oauth2login/src/main/java/sample/user/GitHubOAuth2User.java b/samples/boot/oauth2login/src/main/java/sample/user/GitHubOAuth2User.java deleted file mode 100644 index 424defd589..0000000000 --- a/samples/boot/oauth2login/src/main/java/sample/user/GitHubOAuth2User.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 sample.user; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.AuthorityUtils; -import org.springframework.security.oauth2.core.user.OAuth2User; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author Joe Grandja - */ -public class GitHubOAuth2User implements OAuth2User { - private List authorities = AuthorityUtils.createAuthorityList("ROLE_USER"); - private String id; - private String name; - private String login; - private String email; - - public GitHubOAuth2User() { - } - - @Override - public Collection getAuthorities() { - return this.authorities; - } - - @Override - public Map getAttributes() { - Map attributes = new HashMap<>(); - attributes.put("id", this.getId()); - attributes.put("name", this.getName()); - attributes.put("login", this.getLogin()); - attributes.put("email", this.getEmail()); - return attributes; - } - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - @Override - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLogin() { - return this.login; - } - - public void setLogin(String login) { - this.login = login; - } - - public String getEmail() { - return this.email; - } - - public void setEmail(String email) { - this.email = email; - } -}