0maru / twitter_login

MIT License
54 stars 54 forks source link

this plugin cannot use the Firebase default callback URL. #113

Open imeDevelopers opened 1 year ago

imeDevelopers commented 1 year ago

This sentence is killing your package.

and actually It works normally!

Go TO: https://developer.twitter.com/en/portal/projects add this callback: https://<YOUR FIREBASE APP ID>.firebaseapp.com/__/auth/handler to your app info section

GO TO: https://console.firebase.google.com/project/<YOUR FIREBASE APP ID>/authentication/providers

Press on: Add new provider Select Twitter and Make sure you add apiKey and apiSecretKey

AndroidManifest.xml:

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="<YOUR FIREBASE APP ID>.firebaseapp.com" android:pathPrefix="/__/auth/handler"/>
</intent-filter>

then use the plugin:

await TwitterLogin(
apiKey:'YOUR API KEY',
apiSecretKey:'YOUR API SECRET KEY',
redirectURI:'https://<YOUR FIREBASE APP ID>.firebaseapp.com/__/auth/handler',
).login().then((res)async{
await FirebaseAuth.instance.signInWithCredential(TwitterAuthProvider.credential(accessToken: res.authToken!, secret: res.authTokenSecret!)).then((value){
});
});
0maru commented 1 year ago

Thanks. I will check this out.

arslanrazacrew commented 1 year ago

I did the same but it still gives an error

' Unable to process the request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.'

image

MehmetKaranlik commented 1 year ago

Any solution yet ?

arslanrazacrew commented 1 year ago

Not yet

ParhaMDeF commented 1 year ago

I have this problem too

mootp commented 1 year ago

Any update ?

0maru commented 1 year ago

Sorry it took so long. No update on this.

The error you see after redirecting to xxx.firebaseapp.com/__/auth/handler is not related to this plugin. Because this plugin uses OAuth 2.0, the only time a browser needs to be open is for the user to sign in to their Twitter account.

After signing in to a Twitter account, the user is redirected to the URL specified in redirectURL, and the authToken and authTokenSecret are obtained from the query parameter of that URL, and the redirection destination is irrelevant.

If it does not work, set a different URL. If you have a Firebase project, creating a page for the redirect will work.

For example xxx.firebaseapp.com/signin/redirect/twitter/ The page would work with minimal HTML markup. I will create a sample project when I have time.

I am not good at English. If the explanation is difficult to understand, please contact me so that I can supplement it.

git00000000001 commented 11 months ago

How can this be solved? The problem still exists.

git00000000001 commented 11 months ago

I did the same but it still gives an error

' Unable to process the request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.'

image

Hello, have you resolved this issue? I can log in using the official method provided, but I can't log out.

git00000000001 commented 11 months ago

This sentence is killing your package.

and actually It works normally!

Go TO: https://developer.twitter.com/en/portal/projects add this callback: https://<YOUR FIREBASE APP ID>.firebaseapp.com/__/auth/handler to your app info section

GO TO: https://console.firebase.google.com/project/<YOUR FIREBASE APP ID>/authentication/providers

Press on: Add new provider Select Twitter and Make sure you add apiKey and apiSecretKey

AndroidManifest.xml:

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="<YOUR FIREBASE APP ID>.firebaseapp.com" android:pathPrefix="/__/auth/handler"/>
</intent-filter>

then use the plugin:

await TwitterLogin(
apiKey:'YOUR API KEY',
apiSecretKey:'YOUR API SECRET KEY',
redirectURI:'https://<YOUR FIREBASE APP ID>.firebaseapp.com/__/auth/handler',
).login().then((res)async{
await FirebaseAuth.instance.signInWithCredential(TwitterAuthProvider.credential(accessToken: res.authToken!, secret: res.authTokenSecret!)).then((value){
});
});

Hello, have you resolved this issue? I can log in using the official method provided, but I can't log out.

git00000000001 commented 11 months ago

Any solution yet ?

Hello, have you resolved this issue? I can log in using the official method provided, but I can't log out.

git00000000001 commented 11 months ago

Not yet

Hello, have you resolved this issue? I can log in using the official method provided, but I can't log out.

git00000000001 commented 11 months ago

Any update ?

Hello, have you resolved this issue? I can log in using the official method provided, but I can't log out.

Ashfaque-231219 commented 8 months ago

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared. Some specific scenarios are - 1) Using IDP-Initiated SAML SSO. 2) Using signInWithRedirect in a storage-partitioned browser environment please suggest someone how i will that issue

Ashfaque-231219 commented 8 months ago

anyone having any. suggestion please let me know