浏览代码

Remove GitHubOAuth2User from oauth2Login sample

Fixes gh-4732
Joe Grandja 7 年之前
父节点
当前提交
8e0d88d3e9
共有 1 个文件被更改,包括 0 次插入87 次删除
  1. 0 87
      samples/boot/oauth2login/src/main/java/sample/user/GitHubOAuth2User.java

+ 0 - 87
samples/boot/oauth2login/src/main/java/sample/user/GitHubOAuth2User.java

@@ -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<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList("ROLE_USER");
-	private String id;
-	private String name;
-	private String login;
-	private String email;
-
-	public GitHubOAuth2User() {
-	}
-
-	@Override
-	public Collection<? extends GrantedAuthority> getAuthorities() {
-		return this.authorities;
-	}
-
-	@Override
-	public Map<String, Object> getAttributes() {
-		Map<String, Object> 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;
-	}
-}