SocialiteProviders / Providers

A Collection of Providers for Laravel Socialite
https://socialiteproviders.com
MIT License
499 stars 438 forks source link

Azure B2C provider puts scope incorrectly #1164

Closed baradhili closed 7 months ago

baradhili commented 7 months ago

Running the Azure B2C provider. I was getting an error "AADB2C99005: The request contains an invalid scope parameter which includes an illegal character ','."

Looking up the doco I see the usual terrible Microsoft documentation, but eventually I found that it was supposed to be something like "scope=https://contoso.onmicrosoft.com/api/read openid offline_access" Request an access token in Azure Active Directory B2C

What I get from the provider however is something like "openid,https://contoso.onmicrosoft.com/api/read".

When testing this consistently gives the above error, while "https://contoso.onmicrosoft.com/api/read openid" gives the expected result

Also tested "openid https://contoso.onmicrosoft.com/api/read" also works - so it just looks like Microsoft "Improved" the scope separator just because

baradhili commented 7 months ago

adding to "Provider.php" for azureadb2c the line protected $scopeSeparator = ' '; fixes this which will give "openid+https://contoso.onmicrosoft.com/api/read"