Comments (7)
Seems to affect many providers.
Since socialite updates can break compatibility with providers, one sustainable approach would be to cap the dependency to versions known to work.
from providers.
I think, that we can remove the definition from SocialiteProviders\Apple\Provider:
/**
* Acquire a new access token using the refresh token.
*
* Refer to the documentation for the response structure (the `refresh_token` will be missing from the new response).
*
* @see https://developer.apple.com/documentation/sign_in_with_apple/tokenresponse
*
* @param string $refreshToken
* @return ResponseInterface
*
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function refreshToken(string $refreshToken): ResponseInterface
{
return $this->getHttpClient()->post($this->getTokenUrl(), [
RequestOptions::FORM_PARAMS => [
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
'grant_type' => 'refresh_token',
'refresh_token' => $refreshToken,
],
]);
}
because the parent class Laravel\Socialite\Two\AbstractProvider have:
/**
* Refresh a user's access token with a refresh token.
*
* @param string $refreshToken
* @return \Laravel\Socialite\Two\Token
*/
public function refreshToken($refreshToken)
{
$response = $this->getRefreshTokenResponse($refreshToken);
return new Token(
Arr::get($response, 'access_token'),
Arr::get($response, 'refresh_token'),
Arr::get($response, 'expires_in'),
explode($this->scopeSeparator, Arr::get($response, 'scope', ''))
);
}
/**
* Get the refresh token response for the given refresh token.
*
* @param string $refreshToken
* @return array
*/
protected function getRefreshTokenResponse($refreshToken)
{
return json_decode($this->getHttpClient()->post($this->getTokenUrl(), [
RequestOptions::HEADERS => ['Accept' => 'application/json'],
RequestOptions::FORM_PARAMS => [
'grant_type' => 'refresh_token',
'refresh_token' => $refreshToken,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
],
])->getBody(), true);
}
What do you think?
from providers.
Please PR an update :)
from providers.
It's somewhat hard as people use the main providers from socialite proper, which need updates. And this wasn't a major version bump from their end either.
I have tagged a new apple version, please PR other providers.
from providers.
Is there any other providers with this issue? Apple is resolved now.
from providers.
At least Okta as per the linked issue from socialite proper.
from providers.
I believe all of these are resolved now.
from providers.
Related Issues (20)
- The HTTP status code "0" is not valid on socialiteproviders HOT 1
- Tiktok fails me with the following "code_callengen" HOT 1
- A new release is needed HOT 1
- Driver [figma] not supported HOT 1
- Figma's Authorization Header is wrong HOT 2
- Add dingtalk? HOT 1
- Hability to set WantAssertionsSigned false HOT 1
- Please can you check my pull
- Tiktok Update HOT 2
- StreamElementsProvider needs a new version release on composer HOT 4
- Linkedin: Add Linkedin OpenId Socialite Provider. HOT 1
- Microsoft provider generates error for only some users - error AADSTS900144 HOT 10
- DELETE.
- Microsoft provider does not return refresh_token HOT 3
- SocialiteProviders/Authentik needs a new release HOT 1
- Merge Microsoft and Azure provider HOT 3
- Stateless discord oauth gives 401 unauthorized error when trying to collect user HOT 2
- OIDC token request results in failure multiple_client_credentials HOT 1
- Azure B2C provider failing with not supported? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from providers.