mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #481] Storing OAuthSwiftCredential in UserDefaults #313
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#313
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 @ghost on GitHub (Jul 15, 2018).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/481
So I'm using latest version of Xcode, Swift, and OAuthSwift with a custom PingFederate endpoint that implements OpenID Connect on top of OAuth2. This will generate refresh tokens in when using the returned credential in the success handler, so I would like to store this credential to create automatic login without having to sign in again.
To my knowledge, OAuthSwiftCredential is a Codable object, at least in newer versions of the framework which I have installed via CocoaPods. However, every time I try to store the credential from the success handler in the User Defaults I get a SIGABRT error. I would really appreciate some help.
@jrtibbetts commented on GitHub (Jul 25, 2018):
I posted a similar issue (https://github.com/OAuthSwift/OAuthSwift/issues/453) in May, and it was fixed, but no release has been issued yet that includes it, not even 1.2.2, which is the latest one that's posted. It's such a pain for me that I'm considering replacing OAuthSwift in my project with something else.
@phimage commented on GitHub (Jul 25, 2018):
Closed because issue template has been removed
Then this is a storing problem and no code to store in description
Then not the same issue ...
@ghost commented on GitHub (Jul 26, 2018):
I wrote the issue template in a paragraph format. I ended up getting it to work by encoding it as JSON but I don't understand why I can't directly store the credential considering the fact that it extends the Codable class already.
@phimage commented on GitHub (Jul 26, 2018):
issue template is information that I ask to you when you create the issue
And you remove all the question, do not take time to respond, and you want some help...
then I ask for code
See Prephirences framework, user defaults do not accept any data type, object are converted, to Data for instance
So you need to encode it