mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 05:22:16 +00:00
SEC-1390: Added null check on claimedIdentifier returned by DiscoveryInformation to prevent NPE.
This commit is contained in:
parent
b1243416fc
commit
8720966d20
@ -158,7 +158,7 @@ public class OpenID4JavaConsumer implements OpenIDConsumer {
|
|||||||
}
|
}
|
||||||
} catch (MessageException e) {
|
} catch (MessageException e) {
|
||||||
attributes.clear();
|
attributes.clear();
|
||||||
throw new OpenIDConsumerException("Attribute retrievel failed", e);
|
throw new OpenIDConsumerException("Attribute retrieval failed", e);
|
||||||
}
|
}
|
||||||
if (debug) {
|
if (debug) {
|
||||||
logger.debug("Retrieved attributes" + attributes);
|
logger.debug("Retrieved attributes" + attributes);
|
||||||
@ -169,8 +169,9 @@ public class OpenID4JavaConsumer implements OpenIDConsumer {
|
|||||||
Identifier verified = verification.getVerifiedId();
|
Identifier verified = verification.getVerifiedId();
|
||||||
|
|
||||||
if (verified == null) {
|
if (verified == null) {
|
||||||
|
Identifier id = discovered.getClaimedIdentifier();
|
||||||
return new OpenIDAuthenticationToken(OpenIDAuthenticationStatus.FAILURE,
|
return new OpenIDAuthenticationToken(OpenIDAuthenticationStatus.FAILURE,
|
||||||
discovered.getClaimedIdentifier().getIdentifier(),
|
id == null ? "Unknown" : id.getIdentifier(),
|
||||||
"Verification status message: [" + verification.getStatusMsg() + "]", attributes);
|
"Verification status message: [" + verification.getStatusMsg() + "]", attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user