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

can I set redirect_uri use weibo backend? #345

Closed
duoduo369 opened this issue Aug 8, 2014 · 3 comments
Closed

can I set redirect_uri use weibo backend? #345

duoduo369 opened this issue Aug 8, 2014 · 3 comments

Comments

@duoduo369
Copy link
Contributor

I use sina weibo app, site need I set a redirect_uri, example: http://www.abc.com

when dev, I set SOCIAL_AUTH_WEIBO_KEY and SOCIAL_AUTH_WEIBO_SECRET. auth url is
https://api.weibo.com/oauth2/authorize?state=vwKNabUwlCGKifEVky5TYmiHtCL5ZV7X&redirect_uri=http://192.168.9.191:9444/&response_type=code&client_id=123592348

see that redirect_uri=http://192.168.9.191:9444/, this will cause sina error:redirect_uri_mismatch, because this uri is not the same as I set as sina http://www.abc.com

question is: how to I set that redirect_uri?

Thanks.

@duoduo369
Copy link
Contributor Author

I try these config, It's not work

SOCIAL_AUTH_SANITIZE_REDIRECTS = False 
LOGIN_REDIRECT_URL = 'http://llovebaimuda.herokuapp.com/' 
SOCIAL_AUTH_LOGIN_REDIRECT_URL = 'http://llovebaimuda.herokuapp.com/' 
SOCIAL_AUTH_WEIBO_LOGIN_REDIRECT_URL = 'http://llovebaimuda.herokuapp.com/'

@omab
Copy link
Owner

omab commented Aug 9, 2014

@duoduo369, the redirect_uri shouldn't be http://192.168.9.191:9444/, it should be http://yourdomain.com/complete/weibo and the value you define in Weibo should have the same format.

Also, if you try to look for a setting that sets that forces that domain in the value, there's not such thing, but you can trick the application by adding 127.0.0.1 www.abc.com in your /etc/hosts.

@duoduo369
Copy link
Contributor Author

Amazing! I realy don't know oauth can use hosts file to debug, before this I publish my code online, then test oauth. Brillante idea.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants