Package org.a2aproject.sdk.spec
Record Class DeviceCodeOAuthFlow
java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.DeviceCodeOAuthFlow
- Record Components:
deviceAuthorizationUrl- the device authorization endpoint URL (required)tokenUrl- URL for the token endpoint where credentials are exchanged for tokens (required)refreshUrl- URL for obtaining refresh tokens (optional)scopes- map of available OAuth scopes to their descriptions (required)
public record DeviceCodeOAuthFlow(String deviceAuthorizationUrl, String tokenUrl, String refreshUrl, Map<String,String> scopes)
extends Record
Configuration details for the OAuth 2.0 Device Code flow (RFC 8628).
This flow is designed for input-constrained devices such as IoT devices, and CLI tools where the user authenticates on a separate device.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedeviceAuthorizationUrlrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of therefreshUrlrecord component.scopes()Returns an unmodifiable copy of the scopes map.tokenUrl()Returns the value of thetokenUrlrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DeviceCodeOAuthFlow
public DeviceCodeOAuthFlow(String deviceAuthorizationUrl, String tokenUrl, String refreshUrl, Map<String, String> scopes) Compact constructor that validates required fields.- Parameters:
deviceAuthorizationUrl- the device authorization endpoint URL (required)tokenUrl- URL for the token endpoint where credentials are exchanged for tokens (required)refreshUrl- URL for obtaining refresh tokens (optional)scopes- map of available OAuth scopes to their descriptions (required)- Throws:
IllegalArgumentException- if authorizationUrl, scopes, or tokenUrl is null
-
-
Method Details
-
scopes
Returns an unmodifiable copy of the scopes map.- Returns:
- unmodifiable map of available OAuth scopes to their descriptions
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
deviceAuthorizationUrl
Returns the value of thedeviceAuthorizationUrlrecord component.- Returns:
- the value of the
deviceAuthorizationUrlrecord component
-
tokenUrl
Returns the value of thetokenUrlrecord component.- Returns:
- the value of the
tokenUrlrecord component
-
refreshUrl
Returns the value of therefreshUrlrecord component.- Returns:
- the value of the
refreshUrlrecord component
-