You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d4cee91
Browse filesBrowse the repository at this point in the historyBrowse files
Ramgopal Nagaboina
committed
oauth2: add OIDC nonce and a per-attempt CSRF state
Binds the generic OIDC login to the authorization request:
- the UI generates a random nonce and state per attempt, sends the nonce in
the authorization request, and rejects the callback when the returned
state does not match before the code is exchanged
- the id_token nonce claim is verified against the nonce from the request
(generic OIDC only; the built-in providers ignore it)
Follow-up to apache#14205.
Copy file name to clipboardExpand all lines: plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/api/command/VerifyOAuthCodeAndGetUserCmd.java
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,10 @@ public class VerifyOAuthCodeAndGetUserCmd extends BaseListCmd implements APIAuth
67
67
description = "Domain path for domain-specific OAuth provider lookup. Ignored when Domain ID is passed.", since = "4.23.0")
68
68
privateStringdomainPath;
69
69
70
+
@Parameter(name = ApiConstants.NONCE, type = CommandType.STRING,
71
+
description = "Nonce sent in the authorization request, verified against the id_token for OpenID Connect providers", since = "24.0.0")
Copy file name to clipboardExpand all lines: plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/oidc/GenericOIDCOAuth2Provider.java
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -166,17 +166,26 @@ public boolean verifyUser(String email, String secretCode, Long domainId, String
Copy file name to clipboardExpand all lines: plugins/user-authenticators/oauth2/src/test/java/org/apache/cloudstack/oauth2/oidc/GenericOIDCOAuth2ProviderTest.java
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -264,6 +264,38 @@ public void testUnverifiedEmailIsRejected() throws Exception {
0 commit comments