Minor ticket refresh / role permission improvements

This commit is contained in:
AFaust
2020-02-20 01:52:34 +01:00
parent 5e7e439e19
commit 55184fe219
3 changed files with 8 additions and 6 deletions

View File

@@ -555,7 +555,8 @@ public class IDMClientImpl implements InitializingBean, IDMClient
this.tokenLock.readLock().lock();
try
{
if (this.token != null && (!this.token.canRefresh() || !this.token.shouldRefresh(this.deployment.getTokenMinimumTimeToLive())))
if (this.token != null && this.token.isActive()
&& (!this.token.canRefresh() || !this.token.shouldRefresh(this.deployment.getTokenMinimumTimeToLive())))
{
validToken = this.token.getToken();
}
@@ -570,7 +571,7 @@ public class IDMClientImpl implements InitializingBean, IDMClient
this.tokenLock.writeLock().lock();
try
{
if (this.token != null
if (this.token != null && this.token.isActive()
&& (!this.token.canRefresh() || !this.token.shouldRefresh(this.deployment.getTokenMinimumTimeToLive())))
{
validToken = this.token.getToken();

View File

@@ -32,11 +32,12 @@ function process(permissions)
{
// enhance permissionObj.authority to at least add displayName
// may/will still look like a user in UI which only differentiates groups / users
// UI does not display full authority name unless we include it in the displayName (different to authority picker)
permissionObj.authority = {
name : authority,
fullName : authority,
shortName : authority.substring(5),
displayName : role.description || role.keycloakName
displayName : (role.description || role.keycloakName) + ' (' + authority + ')'
};
}
}