Browse Source

Use empty map for missing additional parameters

Closes gh-1826
Leon Linhart 9 months ago
parent
commit
e8f627f01e

+ 2 - 2
oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2DeviceAuthorizationRequestAuthenticationToken.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ public class OAuth2DeviceAuthorizationRequestAuthenticationToken extends Abstrac
 		this.deviceCode = deviceCode;
 		this.deviceCode = deviceCode;
 		this.userCode = userCode;
 		this.userCode = userCode;
 		this.authorizationUri = null;
 		this.authorizationUri = null;
-		this.additionalParameters = null;
+		this.additionalParameters = Collections.emptyMap();
 		setAuthenticated(true);
 		setAuthenticated(true);
 	}
 	}
 
 

+ 2 - 2
oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2DeviceVerificationAuthenticationToken.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ public class OAuth2DeviceVerificationAuthenticationToken extends AbstractAuthent
 		this.principal = principal;
 		this.principal = principal;
 		this.userCode = userCode;
 		this.userCode = userCode;
 		this.clientId = clientId;
 		this.clientId = clientId;
-		this.additionalParameters = null;
+		this.additionalParameters = Collections.emptyMap();
 		setAuthenticated(true);
 		setAuthenticated(true);
 	}
 	}