Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/io/fusionauth/domain/oauth2/OAuthError.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ public enum OAuthErrorType {
// Used in Introspect validation. See section 2.1 of RFC 7662 https://tools.ietf.org/html/rfc7662
// - Values for 'token_type_hint' are defined by RFC 7009 "OAuth Token Type Hints". https://tools.ietf.org/html/rfc7009
// - Validation for this field is described in section 4.1.1 of RFC 7009.
unsupported_token_type
unsupported_token_type,

// RFC 9449 DPoP Proof of Possession. Section 12.2
// https://datatracker.ietf.org/doc/html/rfc9449
invalid_dpop_proof
}
}
11 changes: 8 additions & 3 deletions src/main/java/io/fusionauth/domain/oauth2/TokenType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2019, FusionAuth, All Rights Reserved
* Copyright (c) 2018-2025, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,14 +22,15 @@
* <a href="https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05">
* Draft RFC on OAuth 2.0 Message Authentication Code (MAC) Tokens</a>
* </li>
* <li>DPoP Token type as defined by <a href="https://datatracker.ietf.org/doc/html/rfc9449"></li>
* </ul>
*
* @author Daniel DeGroff
*/
public enum TokenType {
Bearer,
MAC;

MAC,
DPoP;

public static TokenType fromName(String s) {
if (Bearer.name().equalsIgnoreCase(s)) {
Expand All @@ -40,6 +41,10 @@ public static TokenType fromName(String s) {
return MAC;
}

if (DPoP.name().equalsIgnoreCase(s)) {
return DPoP;
}

return null;
}
}