Skip to content

Commit 525ff38

Browse files
feat(spec)!: modernize oauth 2.0 flows - remove implicit/password, add device code / pkce (#1303)
## Description Modernizes OAuth 2.0 flow support by removing deprecated flows and adding modern, secure alternatives. Fixes: #1234 ## Changes ### Breaking Changes **Removed (deprecated by OAuth 2.0 Security BCP):** - `ImplicitOAuthFlow` - Use Authorization Code + PKCE instead - `PasswordOAuthFlow` - Use Authorization Code + PKCE or Device Code instead ### Added **New OAuth Flow:** - `DeviceCodeOAuthFlow` (RFC 8628) - For CLI tools, IoT devices, and input-constrained scenarios **Enhanced Security:** - `pkce_required` field added to `AuthorizationCodeOAuthFlow` (RFC 7636) Co-authored-by: Darrel <darrmi@microsoft.com>
1 parent e6c5699 commit 525ff38

2 files changed

Lines changed: 21 additions & 32 deletions

File tree

docs/specification.md

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

988988
{{ proto_to_table("specification/grpc/a2a.proto", "ClientCredentialsOAuthFlow") }}
989989

990-
<a id="ImplicitOAuthFlow"></a>
990+
<a id="DeviceCodeOAuthFlow"></a>
991991

992-
#### 4.5.10. ImplicitOAuthFlow
992+
#### 4.5.10. DeviceCodeOAuthFlow
993993

994-
{{ proto_to_table("specification/grpc/a2a.proto", "ImplicitOAuthFlow") }}
995-
996-
<a id="PasswordOAuthFlow"></a>
997-
998-
#### 4.5.11. PasswordOAuthFlow
999-
1000-
{{ proto_to_table("specification/grpc/a2a.proto", "PasswordOAuthFlow") }}
994+
{{ proto_to_table("specification/grpc/a2a.proto", "DeviceCodeOAuthFlow") }}
1001995

1002996
### 4.6. Extensions
1003997

specification/grpc/a2a.proto

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

@@ -679,29 +682,21 @@ message ClientCredentialsOAuthFlow {
679682
}
680683
// --8<-- [end:ClientCredentialsOAuthFlow]
681684

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

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

0 commit comments

Comments
 (0)