Skip to content
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

Change flow of API examples #21

Open
DrkSephy opened this issue May 21, 2015 · 0 comments
Open

Change flow of API examples #21

DrkSephy opened this issue May 21, 2015 · 0 comments

Comments

@DrkSephy
Copy link
Owner

Currently, some API examples require the user to be specifically authenticated to a particular service. For example, the Facebook example will not work if the user is authenticated with Google+. We should have a method that will redirect the user to be authenticated for the proper API method (i.e, if the user is currently logged in through Facebook and wants to use the Dropbox API, we should re-direct the user to be authenticated through Dropbox). This should be done for all the API examples that require authentication.

Also for the examples done by @mk200789, I propose we change the re-direct url structure like this:

  • Let's say the user clicks the Twitter example, but is not authenticated with Twitter. The user is redirected to authenticate with Twitter, and upon successful authentication the user is redirected to http://localhost:8000/hackathon/. Instead, we should then redirect the user to the API example they requested to view (Twitter in this case). An implementation to do is:
    • Create separate callbacks for each API example. For example, Twitter will redirect the user (after authentication) to a url: http://localhost:8000/hackathon/oauthcallback/twitter. On this view function, we now redirect the user to the Twitter example they requested to use.
    • As such, authentication views such as Dropbox would have a redirect_uri of http://localhost:8000/hackathon/oauthcallback/dropbox, and would properly re-direct the user to the API example. This is perhaps a solution to the first problem on top, where if the user isn't authenticated with the right service, we re-direct them to be authenticated, then bring them back to the API they requested to view.

Questions and comments are welcome. This would greatly improve the user flow, as right now it requires the user to log out and log back in with the proper method, and would remove having the user go back to the main page after authenticating for an API examples (as shown by the Twitter example).

dereklarmstrong pushed a commit to dereklarmstrong/django-hackathon-starter that referenced this issue Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants