forked from fp2952/spring-cloud-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fangp
committed
May 3, 2018
1 parent
da4fbec
commit ba76905
Showing
44 changed files
with
12,972 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
...enter/auth-center-api/src/main/java/com/peng/auth/api/pojo/auth/BaseGrantedAuthority.java
This file was deleted.
Oops, something went wrong.
69 changes: 69 additions & 0 deletions
69
auth-center/auth-center-api/src/main/java/com/peng/auth/api/pojo/auth/BaseUserDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.peng.auth.api.pojo.auth; | ||
|
||
import com.peng.main.api.mapper.model.BaseUser; | ||
import org.springframework.security.core.CredentialsContainer; | ||
import org.springframework.security.core.GrantedAuthority; | ||
import org.springframework.security.core.userdetails.User; | ||
import org.springframework.security.core.userdetails.UserDetails; | ||
|
||
import java.util.*; | ||
|
||
/** | ||
* Created by fp295 on 2018/4/29. | ||
* 包装org.springframework.security.core.userdetails.User类 | ||
*/ | ||
public class BaseUserDetail implements UserDetails, CredentialsContainer { | ||
|
||
private final BaseUser baseUser; | ||
private final org.springframework.security.core.userdetails.User user; | ||
|
||
public BaseUserDetail(BaseUser baseUser, User user) { | ||
this.baseUser = baseUser; | ||
this.user = user; | ||
} | ||
|
||
|
||
@Override | ||
public void eraseCredentials() { | ||
user.eraseCredentials(); | ||
} | ||
|
||
@Override | ||
public Collection<? extends GrantedAuthority> getAuthorities() { | ||
return user.getAuthorities(); | ||
} | ||
|
||
@Override | ||
public String getPassword() { | ||
return user.getPassword(); | ||
} | ||
|
||
@Override | ||
public String getUsername() { | ||
return user.getUsername(); | ||
} | ||
|
||
@Override | ||
public boolean isAccountNonExpired() { | ||
return user.isAccountNonExpired(); | ||
} | ||
|
||
@Override | ||
public boolean isAccountNonLocked() { | ||
return user.isAccountNonLocked(); | ||
} | ||
|
||
@Override | ||
public boolean isCredentialsNonExpired() { | ||
return user.isCredentialsNonExpired(); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return user.isEnabled(); | ||
} | ||
|
||
public BaseUser getBaseUser() { | ||
return baseUser; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.