mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #592] Implement another OAuth website #385
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @camillegallet on GitHub (May 2, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/592
Description:
I'm trying to add another OAuth website
This not a bug
OAuth Provider? (Twitter, Github, ..):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
11.x (Swift 5.1)
10.x (Swift 5.0)
10.x (Swift 4.1)
9.3 (Swift 4.1)
9.0 (Swift 4.0)
other: (Please fill in the version you are using.)
objective c
I'm trying OAuthSwift
I've successfully imported the demo project and I try to add another OAuth identification. So before testing to add my company's OAuth to begin I've added this in the ViewController
Secondly, I've edited the ViewDidLoad like that:
And finally
I don't know why I've neither success or failure in the console
What I've done wrong?
Thanks in advance
@mesopelagique commented on GitHub (May 3, 2020):
AppDelegate code ?
The redirection url is important, this url is used to transmit the token of authentication
In readme there is instructions
For instance using special scheme like my app://callback or by getting web view event
OAuthSwift.handle must be called (with the callback url and token added as query parameter)
@camillegallet commented on GitHub (May 3, 2020):
Thanks for your reply
My app delegated class is that:
https://pastebin.com/VZmNGdAN
Also If I add a print like that
I don't see it in the console
@camillegallet commented on GitHub (May 3, 2020):
Just in case I also post the code of Webviewcontroller
https://pastebin.com/Q5grL5qS
@camillegallet commented on GitHub (May 3, 2020):
Some new, I've open the OAuthSwift.xcodeproj, launched it and clicked on Spotify.
In parrallel I've generated a pair Client ID/Client Secret on spotify
I've edited the doOAuthSpotify to print debugging messages
But here is what I've got in the console :
https://pastebin.com/9cYNzPAP
@phimage commented on GitHub (May 4, 2020):
for this last issue, it's a demo issue. The main thread checker is activated, some code are executed in other thread on User Interace but to not have some graphical bugs, it must be in main thread.
To fix a
DispatchQueue.main.async { the code }@phimage commented on GitHub (May 4, 2020):
It's difficult to follow with peace of code. If you create a project on GitHub with no client/consumer id and secret I will study and look for missing code
The important part is the callback url.
If you use one with MyApp:// (like oauthswift:// but you must use your own app name) you must configure your app https://github.com/OAuthSwift/OAuthSwift#setting-url-schemes
If you use https:// url, you must use delegate of web view to get the url and pass it to oauthswift, or be able to add special file on server to redirect http call to your app
@camillegallet commented on GitHub (May 4, 2020):
Here is a copy of my project https://github.com/camillegallet/testOAuth
@phimage commented on GitHub (May 4, 2020):
basically you try to copy the api demo, this app show all provider/services
and multiple methods, and user interface to select service.
maybe the code is too complicated, compared to a simple app with only one service
I could help only if I now where you want to connect, and the service used, ie. link to oauth api documentation, because the code do not show it
So the mobi.kronos-sport.com is based on? wordpress? others?
I see that too
https://stackoverflow.com/questions/61528076/how-can-i-save-credentials-session-in-a-ios-web-app
sensible information on iOS must be stored in Keychain
less sensible could be in userDefaults, file, etc..
I make a project prephirences to manage that but you can find many to store in keychain (awesome swift list done that)
@camillegallet commented on GitHub (May 4, 2020):
For the moment my company is developping an custom homemade OAuth service, that's why I'm trying with spotify (I've logged into developer.spotify.com and register an app to get a pair Client ID/Client Secret)
Yes now I use keychain
@phimage commented on GitHub (May 4, 2020):
ok I could show a simple Spotify app
@phimage commented on GitHub (May 4, 2020):
I close, I cannot offer more support without any issue or real server information