简体   繁体   English

将来自 web 应用程序的 oauth 请求的结果挂钩到 ZE84E30B9390CDB664DB6DB2C9DZ 应用程序中的 Twitter

[英]Hook result of oauth request from web application to Twitter in Android app

I have website, that implements "Sign in with twitter".我有一个网站,它实现了“用 twitter 登录”。

This authorization process: My site redirects user to twitter, then twitter asks user to allow my website access his account, he clicks "Allow", twitter redirects user back to my site, that gets access token.此授权过程:我的网站将用户重定向到 twitter,然后 twitter 要求用户允许我的网站访问他的帐户,他点击“允许”,twitter 将用户重定向回我的网站。

Also I have an Android app, that needs to initialize this auth process and finally get result.我还有一个 Android 应用程序,它需要初始化这个身份验证过程并最终得到结果。 I can create intent, that opens url in browser, and all next steps go in browser, but can I hook somehow when browser is closed, or (that will be better) when browser gets final redirect, to check if authorization was OK and my website now can access user's twitter account, and close browser?我可以创建意图,在浏览器中打开 url,并在浏览器中打开所有后续步骤 go,但是我可以在浏览器关闭时以某种方式挂钩,或者(这会更好)当浏览器获得最终重定向时,检查授权是否正常以及我的网站现在可以访问用户的twitter账号,关闭浏览器了吗?

Do I need investigate about WebView, or this functionality can be implemented using regular Android browser?我是否需要调查 WebView,或者这个功能可以使用常规的 Android 浏览器来实现?

I believe what you are looking for is setting up a custom scheme .我相信您正在寻找的是设置自定义方案 With this you can set up a appname as a scheme and when you generate a request token from Twitter with an oauth_callback as appname://callback the user will be redirected back to that uri after authorizing and it will open your app.有了这个,您可以将 appname 设置为方案,当您从 Twitter 生成请求令牌时, oauth_callbackappname://callback ,用户将在授权后被重定向回该 uri,它将打开您的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 适用于Android的Twitter的oAuth错误 - Error in oAuth for Twitter for Android 在防火墙后面的Wildfly / Keycloak安全Web应用程序调用时使用oauth2保护Google App Engine应用程序的安全 - Securing a google app engine application with oauth2 on call from a Wildfly/Keycloak secured web application behind a firewall 使用Oauth2.0 / OpenId Hybrid验证Android应用程序和Web应用程序(后端服务器) - Using Oauth2.0 / OpenId Hybrid to authenticate Android app and a Web Application (Backend Server) 如何启动从Java Web应用程序到Android客户端的请求 - How to initiate request from java web application to android client 如何从Android应用程序内部发送网络请求? - How can you send a web request from inside an Android app? 无法正确签署Twitter OAuth 1请求 - Cannot properly sign Twitter OAuth 1 request HttpUrlConnection-Android应用-带有Spring Web Service的oauth2授权 - HttpUrlConnection - android app - oauth2 authorization with spring web service Google App Script API 访问,在 android 应用程序中使用 OAuth idToken - Google App Script API access, with OAuth idToken in android application 用于java Web应用程序的shutdown hook - shutdown hook for java web application 尝试从Twitter API获取Oauth request_token时出现“未经授权”错误 - Getting “Unauthorized” Error while trying to get Oauth request_token from twitter API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM