Skip to content

Commit 40e7c2e

Browse files
msardaraTehsmash
authored andcommitted
feat(spec): modernize oauth 2.0 flows - remove implicit/password, add device code / pkce
1 parent a336a5a commit 40e7c2e

File tree

2 files changed

+21
-32
lines changed

2 files changed

+21
-32
lines changed

docs/specification.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -963,17 +963,11 @@ For detailed security guidance on push notifications, see [Section 13.2 Push Not
963963

964964
{{ proto_to_table("specification/grpc/a2a.proto", "ClientCredentialsOAuthFlow") }}
965965

966-
<a id="ImplicitOAuthFlow"></a>
966+
<a id="DeviceCodeOAuthFlow"></a>
967967

968-
#### 4.5.10. ImplicitOAuthFlow
968+
#### 4.5.10. DeviceCodeOAuthFlow
969969

970-
{{ proto_to_table("specification/grpc/a2a.proto", "ImplicitOAuthFlow") }}
971-
972-
<a id="PasswordOAuthFlow"></a>
973-
974-
#### 4.5.11. PasswordOAuthFlow
975-
976-
{{ proto_to_table("specification/grpc/a2a.proto", "PasswordOAuthFlow") }}
970+
{{ proto_to_table("specification/grpc/a2a.proto", "DeviceCodeOAuthFlow") }}
977971

978972
### 4.6. Extensions
979973

specification/grpc/a2a.proto

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -641,15 +641,15 @@ message MutualTlsSecurityScheme {
641641
// --8<-- [start:OAuthFlows]
642642
// Defines the configuration for the supported OAuth 2.0 flows.
643643
message OAuthFlows {
644+
// Tags 3 and 4 were previously used by deprecated OAuth flows.
645+
reserved 3, 4;
644646
oneof flow {
645647
// Configuration for the OAuth Authorization Code flow.
646648
AuthorizationCodeOAuthFlow authorization_code = 1;
647649
// Configuration for the OAuth Client Credentials flow.
648650
ClientCredentialsOAuthFlow client_credentials = 2;
649-
// Configuration for the OAuth Implicit flow.
650-
ImplicitOAuthFlow implicit = 3;
651-
// Configuration for the OAuth Resource Owner Password flow.
652-
PasswordOAuthFlow password = 4;
651+
// Configuration for the OAuth Device Code flow.
652+
DeviceCodeOAuthFlow device_code = 5;
653653
}
654654
}
655655
// --8<-- [end:OAuthFlows]
@@ -665,6 +665,9 @@ message AuthorizationCodeOAuthFlow {
665665
string refresh_url = 3;
666666
// The available scopes for the OAuth2 security scheme.
667667
map<string, string> scopes = 4 [(google.api.field_behavior) = REQUIRED];
668+
// Indicates if PKCE (RFC 7636) is required for this flow.
669+
// PKCE should always be used for public clients and is recommended for all clients.
670+
bool pkce_required = 5;
668671
}
669672
// --8<-- [end:AuthorizationCodeOAuthFlow]
670673

@@ -680,29 +683,21 @@ message ClientCredentialsOAuthFlow {
680683
}
681684
// --8<-- [end:ClientCredentialsOAuthFlow]
682685

683-
// --8<-- [start:ImplicitOAuthFlow]
684-
// Defines configuration details for the OAuth 2.0 Implicit flow.
685-
message ImplicitOAuthFlow {
686-
// The authorization URL to be used for this flow.
687-
string authorization_url = 1 [(google.api.field_behavior) = REQUIRED];
688-
// The URL to be used for obtaining refresh tokens.
689-
string refresh_url = 2;
690-
// The available scopes for the OAuth2 security scheme.
691-
map<string, string> scopes = 3 [(google.api.field_behavior) = REQUIRED];
692-
}
693-
// --8<-- [end:ImplicitOAuthFlow]
694-
695-
// --8<-- [start:PasswordOAuthFlow]
696-
// Defines configuration details for the OAuth 2.0 Resource Owner Password flow.
697-
message PasswordOAuthFlow {
686+
// --8<-- [start:DeviceCodeOAuthFlow]
687+
// Defines configuration details for the OAuth 2.0 Device Code flow (RFC 8628).
688+
// This flow is designed for input-constrained devices such as IoT devices,
689+
// and CLI tools where the user authenticates on a separate device.
690+
message DeviceCodeOAuthFlow {
691+
// The device authorization endpoint URL.
692+
string device_authorization_url = 1 [(google.api.field_behavior) = REQUIRED];
698693
// The token URL to be used for this flow.
699-
string token_url = 1 [(google.api.field_behavior) = REQUIRED];
694+
string token_url = 2 [(google.api.field_behavior) = REQUIRED];
700695
// The URL to be used for obtaining refresh tokens.
701-
string refresh_url = 2;
696+
string refresh_url = 3;
702697
// The available scopes for the OAuth2 security scheme.
703-
map<string, string> scopes = 3 [(google.api.field_behavior) = REQUIRED];
698+
map<string, string> scopes = 4 [(google.api.field_behavior) = REQUIRED];
704699
}
705-
// --8<-- [end:PasswordOAuthFlow]
700+
// --8<-- [end:DeviceCodeOAuthFlow]
706701

707702
///////////// Request Messages ///////////
708703
// --8<-- [start:SendMessageRequest]

0 commit comments

Comments
 (0)