Skip to content

Commit 402da19

Browse files
bhalseywied03Copilot
authored
Feature/dpop (#1269)
DPoP support --------- Co-authored-by: Brady Wied <brady.wied@fusionauth.io> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Brady Wied <wied03@users.noreply.github.com>
1 parent d09e7bb commit 402da19

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/main/java/io/fusionauth/domain/OpenIdConfiguration.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2025, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2026, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,6 +39,11 @@ public class OpenIdConfiguration implements Buildable<OpenIdConfiguration> {
3939

4040
public String device_authorization_endpoint = "%s/oauth2/device_authorize";
4141

42+
/**
43+
* RFC9449 5.1 add dpop_signing_alg_values_supported. Symmetric algorithms cannot be used
44+
*/
45+
public List<String> dpop_signing_alg_values_supported = new ArrayList<>(Arrays.asList("Ed448", "Ed25519", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "RS256", "RS384", "RS512"));
46+
4247
public String end_session_endpoint = "%s/oauth2/logout";
4348

4449
@SuppressWarnings("SpellCheckingInspection")
@@ -82,6 +87,7 @@ public boolean equals(Object o) {
8287
Objects.equals(authorization_endpoint, that.authorization_endpoint) &&
8388
Objects.equals(claims_supported, that.claims_supported) &&
8489
Objects.equals(device_authorization_endpoint, that.device_authorization_endpoint) &&
90+
Objects.equals(dpop_signing_alg_values_supported, that.dpop_signing_alg_values_supported) &&
8591
Objects.equals(end_session_endpoint, that.end_session_endpoint) &&
8692
Objects.equals(grant_types_supported, that.grant_types_supported) &&
8793
Objects.equals(id_token_signing_alg_values_supported, that.id_token_signing_alg_values_supported) &&
@@ -99,7 +105,7 @@ public boolean equals(Object o) {
99105

100106
@Override
101107
public int hashCode() {
102-
return Objects.hash(authorization_endpoint, backchannel_logout_supported, claims_supported, device_authorization_endpoint, end_session_endpoint, frontchannel_logout_supported, grant_types_supported, id_token_signing_alg_values_supported, issuer, jwks_uri, response_modes_supported, response_types_supported, scopes_supported, subject_types_supported, token_endpoint, token_endpoint_auth_methods_supported, userinfo_endpoint, userinfo_signing_alg_values_supported);
108+
return Objects.hash(authorization_endpoint, backchannel_logout_supported, claims_supported, device_authorization_endpoint, dpop_signing_alg_values_supported, end_session_endpoint, frontchannel_logout_supported, grant_types_supported, id_token_signing_alg_values_supported, issuer, jwks_uri, response_modes_supported, response_types_supported, scopes_supported, subject_types_supported, token_endpoint, token_endpoint_auth_methods_supported, userinfo_endpoint, userinfo_signing_alg_values_supported);
103109
}
104110

105111
@Override

src/main/java/io/fusionauth/domain/oauth2/OAuthError.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ public enum OAuthErrorType {
195195
// Used in Introspect validation. See section 2.1 of RFC 7662 https://tools.ietf.org/html/rfc7662
196196
// - Values for 'token_type_hint' are defined by RFC 7009 "OAuth Token Type Hints". https://tools.ietf.org/html/rfc7009
197197
// - Validation for this field is described in section 4.1.1 of RFC 7009.
198-
unsupported_token_type
198+
unsupported_token_type,
199+
200+
// RFC 9449 DPoP Proof of Possession. Section 12.2
201+
// https://datatracker.ietf.org/doc/html/rfc9449
202+
invalid_dpop_proof
199203
}
200204
}

src/main/java/io/fusionauth/domain/oauth2/TokenType.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2019, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2025, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,14 +22,15 @@
2222
* <a href="https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05">
2323
* Draft RFC on OAuth 2.0 Message Authentication Code (MAC) Tokens</a>
2424
* </li>
25+
* <li>DPoP Token type as defined by <a href="https://datatracker.ietf.org/doc/html/rfc9449">RFC 9449</a></li>
2526
* </ul>
2627
*
2728
* @author Daniel DeGroff
2829
*/
2930
public enum TokenType {
3031
Bearer,
31-
MAC;
32-
32+
MAC,
33+
DPoP;
3334

3435
public static TokenType fromName(String s) {
3536
if (Bearer.name().equalsIgnoreCase(s)) {
@@ -40,6 +41,10 @@ public static TokenType fromName(String s) {
4041
return MAC;
4142
}
4243

44+
if (DPoP.name().equalsIgnoreCase(s)) {
45+
return DPoP;
46+
}
47+
4348
return null;
4449
}
4550
}

src/main/java/io/fusionauth/domain/reactor/ReactorStatus.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021-2025, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2021-2026, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,6 +49,8 @@ public class ReactorStatus {
4949

5050
public ReactorFeatureStatus connectors = ReactorFeatureStatus.UNKNOWN;
5151

52+
public ReactorFeatureStatus dPoP = ReactorFeatureStatus.UNKNOWN;
53+
5254
public ReactorFeatureStatus entityManagement = ReactorFeatureStatus.UNKNOWN;
5355

5456
public LocalDate expiration;
@@ -90,6 +92,7 @@ public ReactorStatus(ReactorStatus other) {
9092
advancedOAuthScopes = other.advancedOAuthScopes;
9193
advancedOAuthScopesCustomScopes = other.advancedOAuthScopesCustomScopes;
9294
advancedOAuthScopesThirdPartyApplications = other.advancedOAuthScopesThirdPartyApplications;
95+
dPoP = other.dPoP;
9396
entityManagement = other.entityManagement;
9497
expiration = other.expiration;
9598
licenseAttributes.putAll(other.licenseAttributes);
@@ -124,6 +127,7 @@ public boolean equals(Object o) {
124127
advancedOAuthScopes == that.advancedOAuthScopes &&
125128
advancedOAuthScopesCustomScopes == that.advancedOAuthScopesCustomScopes &&
126129
advancedOAuthScopesThirdPartyApplications == that.advancedOAuthScopesThirdPartyApplications &&
130+
dPoP == that.dPoP &&
127131
entityManagement == that.entityManagement &&
128132
Objects.equals(expiration, that.expiration) &&
129133
licensed == that.licensed &&
@@ -148,6 +152,7 @@ public int hashCode() {
148152
applicationThemes,
149153
breachedPasswordDetection,
150154
connectors,
155+
dPoP,
151156
advancedOAuthScopes,
152157
advancedOAuthScopesCustomScopes,
153158
advancedOAuthScopesThirdPartyApplications,

0 commit comments

Comments
 (0)