-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
[Question] Further token authentication API examples #13
Comments
There isn't a whole lot of public example code yet. You’ll find some hints in the configuration chapter of the user guide and in the API docs for invalidateConfiguration. Although there isn’t currently time available for it, my hope to write up a cookbook of examples for the 1.0 release. If you can pose a more specific question, I can help point you in the right direction. |
The cookbook sounds great. Question wise, how would you handle oAuth 2 with Siesta? |
I’d first select a third-party lib such as p2/OAuth2 or dongri/OAuthSwift to handle the whole dance of acquiring an OAuth token. That's well outside the scope of Siesta. Once you have a token, you’d do something like this:
…and then when authentication succeeds:
…and for logout:
You could integrate OAuth more tightly with Siesta. For example, you could add special error handling hooks in your Siesta config to trigger a token refresh when you detect an OAuth error. However, I’d start with something as simple as the code above and see what other needs you have. |
I added some of this info to the Siesta docs: http://bustoutsolutions.github.io/siesta/guide/security/ Closing this issue, but feel free to post more on Stack Overflow (with the |
Is there any further API examples? Would be great to see how this could be implemented with a token based authentication system.
The text was updated successfully, but these errors were encountered: