cleaned up introspection endpoint processing
parent
764df71758
commit
621399545e
|
@ -105,7 +105,7 @@ public class IntrospectionEndpoint {
|
||||||
|
|
||||||
String authClientId = auth.getName(); // direct authentication puts the client_id into the authentication's name field
|
String authClientId = auth.getName(); // direct authentication puts the client_id into the authentication's name field
|
||||||
authClient = clientService.loadClientByClientId(authClientId);
|
authClient = clientService.loadClientByClientId(authClientId);
|
||||||
|
|
||||||
if (!AuthenticationUtilities.hasRole(auth, "ROLE_CLIENT")
|
if (!AuthenticationUtilities.hasRole(auth, "ROLE_CLIENT")
|
||||||
|| !authClient.isAllowIntrospection()) {
|
|| !authClient.isAllowIntrospection()) {
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ public class IntrospectionEndpoint {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authClient != null) {
|
if (authClient == null) {
|
||||||
// shouldn't ever get here, if the client's been authenticated by now it should exist
|
// shouldn't ever get here, if the client's been authenticated by now it should exist
|
||||||
logger.error("Introspection client wasn't found");
|
logger.error("Introspection client wasn't found");
|
||||||
model.addAttribute("code", HttpStatus.FORBIDDEN);
|
model.addAttribute("code", HttpStatus.FORBIDDEN);
|
||||||
|
@ -147,7 +147,7 @@ public class IntrospectionEndpoint {
|
||||||
user = userInfoService.getByUsernameAndClientId(userName, tokenClient.getClientId());
|
user = userInfoService.getByUsernameAndClientId(userName, tokenClient.getClientId());
|
||||||
|
|
||||||
} catch (InvalidTokenException e) {
|
} catch (InvalidTokenException e) {
|
||||||
logger.info("Invalid access token. Checking refresh token.");
|
logger.info("Invalid access token. Checking refresh token.", e);
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// check refresh tokens next
|
// check refresh tokens next
|
||||||
|
@ -168,9 +168,6 @@ public class IntrospectionEndpoint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accessToken == null && refreshToken == null) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (introspectionAuthorizer.isIntrospectionPermitted(authClient, tokenClient, scopes)) {
|
if (introspectionAuthorizer.isIntrospectionPermitted(authClient, tokenClient, scopes)) {
|
||||||
// if it's a valid token, we'll print out information on it
|
// if it's a valid token, we'll print out information on it
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue