Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Can not sign in OAuth 2.0 in physical device #149

Open
serkanozcan opened this issue Jan 28, 2023 · 3 comments
Open

Can not sign in OAuth 2.0 in physical device #149

serkanozcan opened this issue Jan 28, 2023 · 3 comments

Comments

@serkanozcan
Copy link

Hi,

I'm having an issue trying to log in with OAuth 2.0 in physical device. It works when native twitter app not installed on device. But if twitter app is installed on device it stucks after entering username and password like this.

IMG_5134

i tried TwitterAPIKit-iOS-sample and same thing happened.

@serkanozcan
Copy link
Author

there is a thread in twitter community. They said issue resolved but at my side not resolved.

https://twittercommunity.com/t/login-with-twitter-is-now-broken-on-ios/182126/11

@serkanozcan
Copy link
Author

@hearther
Copy link

hearther commented Feb 9, 2023

Hi, there

I found way to fix this
OAuth2CodeFlowPKCEViewController.swift line 39

let state = "<state_here>" // Rewrite your state
to
//random string
let state = String(
String(repeating: "a", count: 128).compactMap { _ in
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".randomElement()
}
)
then it work!!

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

No branches or pull requests

2 participants