fix: update OAuth2 grant handlers to use accessTokenUrl instead of authorizationUrl

This commit is contained in:
Udhay-Adithya
2025-07-23 13:31:43 +05:30
parent 728cc52d9c
commit baac50f1ba

View File

@@ -104,7 +104,7 @@ Future<oauth2.Client> oAuth2ClientCredentialsGrantHandler({
// Otherwise, perform the client credentials grant
final client = await oauth2.clientCredentialsGrant(
Uri.parse(oauth2Model.authorizationUrl),
Uri.parse(oauth2Model.accessTokenUrl),
oauth2Model.clientId,
oauth2Model.clientSecret,
scopes: oauth2Model.scope != null ? [oauth2Model.scope!] : null,
@@ -157,7 +157,7 @@ Future<oauth2.Client> oAuth2ResourceOwnerPasswordGrantHandler({
// Otherwise, perform the owner password grant
final client = await oauth2.resourceOwnerPasswordGrant(
Uri.parse(oauth2Model.authorizationUrl),
Uri.parse(oauth2Model.accessTokenUrl),
oauth2Model.username!,
oauth2Model.password!,
identifier: oauth2Model.clientId,