Skip to content

Commit 1f733b9

Browse files
author
FusionAuth Automation
committed
Sync from monorepo fb44388a5e35
1 parent 264782e commit 1f733b9

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

src/main/java/io/fusionauth/domain/jwt/RefreshToken.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
*/
1616
package io.fusionauth.domain.jwt;
1717

18+
import java.net.URI;
1819
import java.time.ZoneOffset;
1920
import java.time.ZonedDateTime;
21+
import java.util.ArrayList;
2022
import java.util.LinkedHashMap;
2123
import java.util.LinkedHashSet;
24+
import java.util.List;
2225
import java.util.Map;
2326
import java.util.Objects;
2427
import java.util.Set;
@@ -151,6 +154,8 @@ public static class MetaData implements Buildable<MetaData> {
151154

152155
public DeviceInfo device = new DeviceInfo();
153156

157+
public List<URI> resources;
158+
154159
@JsonDeserialize(as = LinkedHashSet.class)
155160
public Set<String> scopes;
156161

@@ -163,6 +168,9 @@ public MetaData(MetaData other) {
163168
this.data = new LinkedHashMap<>(other.data);
164169
}
165170
this.device = new DeviceInfo(other.device);
171+
if (other.resources != null) {
172+
this.resources = new ArrayList<>(other.resources);
173+
}
166174
if (other.scopes != null) {
167175
this.scopes = new LinkedHashSet<>(other.scopes);
168176
}
@@ -179,12 +187,13 @@ public boolean equals(Object o) {
179187
MetaData metaData = (MetaData) o;
180188
return Objects.equals(data, metaData.data) &&
181189
Objects.equals(device, metaData.device) &&
190+
Objects.equals(resources, metaData.resources) &&
182191
Objects.equals(scopes, metaData.scopes);
183192
}
184193

185194
@Override
186195
public int hashCode() {
187-
return Objects.hash(data, device, scopes);
196+
return Objects.hash(data, device, resources, scopes);
188197
}
189198

190199
@Override

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public class OAuth2Configuration implements Buildable<OAuth2Configuration> {
4242
@JsonMerge(OptBoolean.FALSE)
4343
public List<URI> authorizedRedirectURLs = new ArrayList<>();
4444

45+
@JsonMerge(OptBoolean.FALSE)
46+
public List<URI> authorizedResourceUris = new ArrayList<>();
47+
4548
public Oauth2AuthorizedURLValidationPolicy authorizedURLValidationPolicy = Oauth2AuthorizedURLValidationPolicy.ExactMatch;
4649

4750
public ClientAuthenticationPolicy clientAuthenticationPolicy;
@@ -94,6 +97,7 @@ public OAuth2Configuration() {
9497
public OAuth2Configuration(OAuth2Configuration other) {
9598
this.authorizedOriginURLs.addAll(other.authorizedOriginURLs);
9699
this.authorizedRedirectURLs.addAll(other.authorizedRedirectURLs);
100+
this.authorizedResourceUris.addAll(other.authorizedResourceUris);
97101
this.authorizedURLValidationPolicy = other.authorizedURLValidationPolicy;
98102
this.clientAuthenticationPolicy = other.clientAuthenticationPolicy;
99103
this.clientId = other.clientId;
@@ -134,6 +138,7 @@ public boolean equals(Object o) {
134138
requireRegistration == that.requireRegistration &&
135139
Objects.equals(authorizedOriginURLs, that.authorizedOriginURLs) &&
136140
Objects.equals(authorizedRedirectURLs, that.authorizedRedirectURLs) &&
141+
Objects.equals(authorizedResourceUris, that.authorizedResourceUris) &&
137142
Objects.equals(authorizedURLValidationPolicy, that.authorizedURLValidationPolicy) &&
138143
Objects.equals(clientAuthenticationPolicy, that.clientAuthenticationPolicy) &&
139144
Objects.equals(clientId, that.clientId) &&
@@ -163,12 +168,13 @@ public URI getFirstAuthorizedRedirectURLIgnoringPatterns() {
163168

164169
@Override
165170
public int hashCode() {
166-
return Objects.hash(authorizedOriginURLs, authorizedRedirectURLs, authorizedURLValidationPolicy, clientAuthenticationPolicy, clientId, clientSecret, consentMode, debug, deviceVerificationURL, enabledGrants, generateRefreshTokens, logoutBehavior, logoutURL, providedScopePolicy, proofKeyForCodeExchangePolicy, relationship, requireClientAuthentication, requireRegistration, scopeHandlingPolicy, unknownScopePolicy);
171+
return Objects.hash(authorizedOriginURLs, authorizedRedirectURLs, authorizedResourceUris, authorizedURLValidationPolicy, clientAuthenticationPolicy, clientId, clientSecret, consentMode, debug, deviceVerificationURL, enabledGrants, generateRefreshTokens, logoutBehavior, logoutURL, providedScopePolicy, proofKeyForCodeExchangePolicy, relationship, requireClientAuthentication, requireRegistration, scopeHandlingPolicy, unknownScopePolicy);
167172
}
168173

169174
public void normalize() {
170175
removeEmpty(authorizedOriginURLs);
171176
removeEmpty(authorizedRedirectURLs);
177+
removeEmpty(authorizedResourceUris);
172178
clientId = trim(clientId);
173179
clientSecret = trim(clientSecret);
174180
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public enum OAuthErrorReason {
105105
invalid_entity_permission_scope,
106106
invalid_user_id,
107107
invalid_tenant_id,
108-
109108
// Grant disabled
110109
grant_type_disabled,
111110

@@ -199,6 +198,10 @@ public enum OAuthErrorType {
199198

200199
// RFC 9449 DPoP Proof of Possession. Section 12.2
201200
// https://datatracker.ietf.org/doc/html/rfc9449
202-
invalid_dpop_proof
201+
invalid_dpop_proof,
202+
203+
// RFC 8707 Resource Indicators
204+
// https://datatracker.ietf.org/doc/html/rfc8707
205+
invalid_target
203206
}
204207
}

0 commit comments

Comments
 (0)