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
Dynamic callback URL? #192
Comments
Hello, $scope.authenticate = function(provider) {
$auth.authenticate(provider);
}; Is there a trick to do it? |
Hi @Guiiks, I've done some research concerning dynamic callback URLs with OAuth and it seems like really the only way to avoid redirecting the user away from the current page they log-in on is to have the entire OAuth experience take place in a JavaScript pop-up window. This post seems to cover the topic: http://stackoverflow.com/questions/1878529/twitter-oauth-via-a-popup I would love to know if anybody else has any other ideas or solutions or can at least further expand on the JavaScript pop-up approach. Thank you |
@Guiiks I will take a look at this issue in more detail later this week and try to come up with some solution. |
hi @sahat, do you happen to have any insight on the dynamic callback situation or does it definitely have to be a hardcoded static url? any other ideas for how to solve the problem? thanks |
I don't think it has to be hard-coded @bhousman. With the current implementation callback is assigned during The authorization endpoint with client code, redirect url, scope, etc is not generated after you click on the login button anyway. E.g. |
@sahat the different social login providers (FB, Twitter, Google) are all requiring I enter a callback URL in their respective developer consoles -- wouldn't changing the redirect URI conflict with what I have set in those sites as they have to match? |
I would like this as well. i am looking to do something on the fly like
and have that redirectUri override the one i put in the config setup |
@chrishawn exactly what i'm looking for 👍 |
I think I understand what you are trying to do. You might be refering to the route redirect rather than callback url you set during the configuration step via $authProvider. The Let's say a user visits http://example.com/XH12aT1771 and clicks on Sign in with a Provider. Satellizer by default uses the hostname as the redirectUri for each provider: redirectUri: window.location.origin // will simply be http://example.com That's where Provider will redirect back inside this popup with an authorization code (or access_token if you are using implicit grant) as part of the query string parameter. It then exchanges that code for JWT and popup is usually closed before you can blink an eye. After that it's up to you what you'd like to do next. By default after signing up it will redirect to If you do not wish to redirect then set $auth.authenticate('myOauthProvider',).then() {
$location.path('/' + uniqueId);
} Hopefully that answers your question assuming I understood it correctly? |
@sahat Thanks for the suggestion. Let me try this and I will report back with my findings. Best Regards. |
@sahat Excellent solution. Works great. Thank you. |
Cheers. Closing this issue. |
Thanks, this config setting solved a problem for me too. |
My app does not have a consistent login page such as
http://example.com/login
. Rather my app's URLs are dynamic and token based, for example:http://example.com/XH12aT1771
. My login box consists of a modal overlaid on top of this dynamic-type page.Is it possible for me to avoid redirecting a user to a static callback url upon authenticating, such as
http://example.com/success
? The problem with redirecting a user to a static callback url is it's a poor user experience as it takes the user away from the page they're on.Are there any other solutions to avoid redirecting the user such as presenting a popup window?
The text was updated successfully, but these errors were encountered: