Skip to content

Error when trying to use with iPhone #1351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Geovanek opened this issue Apr 19, 2025 · 2 comments
Open

Error when trying to use with iPhone #1351

Geovanek opened this issue Apr 19, 2025 · 2 comments

Comments

@Geovanek
Copy link

I have a problem when users try to link their Garmin account to my platform using an iPhone.

The error that appears is this:

SocialiteProviders\GarminConnect\Server::getTokenCredentials(): Argument #1 ($temporaryCredentials) must be of type League\OAuth1\Client\Credentials\TemporaryCredentials, false given

The error occurs when trying to get the user

public function GarminRedirect(): RedirectResponse
{
/** @phpstan-ignore-next-line */
return Socialite::driver(ProviderType::GARMIN->value)
->redirect(); }

 public function GarminCallback(): RedirectResponse
 {
 try {
 /** @phpstan-ignore-next-line */
 $userProvider = Socialite::driver(ProviderType::GARMIN->value)->user();

 } catch (Exception $e) {
 return redirect('/')->with('toastr::warning', $e->getMessage());
 }

Has anyone experienced this, do you know what I might be doing wrong?

According to chatGPT

  1. Cookies blocked in Safari (iOS)
    Safari (and apps that use WebView on iOS) has a more restrictive policy with third-party cookies and cross-site tracking, which can prevent Socialite from maintaining the authentication state (e.g., the temporary token saved in the session).

This means that when you return from Garmin to your application, the temporary token is no longer available in the session, and so the getTokenCredentials() method tries to use false instead of a valid object.

@atymic
Copy link
Member

atymic commented Apr 22, 2025

Have you tried using stateless?

@Geovanek
Copy link
Author

Have you tried using stateless?

I tried, but then it didn't work at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants