接入google 登录 google oauth2
注册谷歌账号 去创建 一个app设置的 url 访问 一定要和第二步中的http://www.newplat.com/google/googleLogin 一致
demo : https://developers.google.com/oauthplayground
文档 :https://developers.google.com/accounts/docs/OAuth2Login
修改应用:https://cloud.google.com/console/project/xxxxxxxxxx/apiui/credential
scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
1. https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/userinfo.email&response_type=code&redirect_uri=http://www.newplat.com/google/googleLogin&client_id=xxxxxxxxxxx.apps.googleusercontent.com
2.http://www.newplat.com/google/googleLogin?code=4/eYbEPfgh5yY3aTGtWPuaYQrtO_GG.0sy18st9VmcfXE-sT2ZLcbSvGvSHhwI
3.post https://accounts.google.com/o/oauth2/token
code=4%2F6VO4EljtH_rFmbhcJZdZXFc572Lu.ImOFJCmmwDMXXE-sT2ZLcbQVlaCahwI&
redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&
client_id=xxxxxxxxxxx.apps.googleusercontent.com
&scope=&
client_secret=************&
grant_type=authorization_code
返回:
access_token A token that can be sent to a Google API.
id_token A JWT that contains identity information about the user that is digitally signed by Google.
expires_in The remaining lifetime of the access token.
token_type Identifies the type of token returned. At this time, this field always has the value Bearer.
refresh_token (optional) This field is only present if access_type=offline is included in the authentication request. For details, see Refresh tokens.
4.https://www.googleapis.com/userinfo/v2/me 主要使用 token_type+空格+access_token
设置http 的header
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("Authorization", authorization);
格式:
Authorization: Bearer ya29.1.AADtN_Xp8k1tQyAjXIqwZjPehZgEi2NJpIIItcrtyHdFrNLqsDvtX8KgOA4GJ0w
接入google 登录 google oauth2相关推荐
- 【unity】Google 登录和Google支付接入unity
公司项目需要上线谷歌商店,因为某些原因不得不接手SDK接入的任务.然而作为一个菜鸡,实在是有点难为我了,磨磨唧唧搞了半个月才搞好.感谢老大的宽容. 目录 Google 登录 Google Play G ...
- Google登录和facebook登录相关
1:google登录 google登录和Facebook登录都是提供的自定义view按钮: <com.google.android.gms.common.SignInButtonandroid: ...
- java oauth2.0_教程:如何实现Java OAuth 2.0以使用GitHub和Google登录
java oauth2.0 将Google和GitHub OAuth登录添加到Java应用程序的指南 我们添加到Takipi的最新功能之一是3rd party登录. 如果您像我一样懒惰,那么我想您也希 ...
- (unity)新手接入Facebook登录,分享以及google登录,Android,IOS,OC接入篇
最近接Android,IOS的Facebook登录,分享 以及Google登录,分享流程以及遇到的问题整理. 一. Android接入 google登录 第一步,前往 [ firebase] http ...
- Unity接入Google登录
Unity接入Google登录 接入FireBaseSdk和GoogleSignIn插件 FireBase接入文档 GoogleSignIn 编写登录代码 可能出现的问题 运行时弹出Google登录界 ...
- Google登录接入
本文章仅作为个人笔记 Google登录官网 Google登录官方快速入门文档 GoogleApi控制台 Google登录接入前提: 开发者: 拥有google开发者账号 添加必要jar包 implem ...
- Android Google登录接入
一.接入准备 手机必须有Google套件 Google服务框架,Google Play商店,Google Play服务(使用su谷歌安装器下载安装) 手机必须可以翻墙 google开发者账号 二.官网 ...
- Unity:Firebase接入Google登录
Unity:Firebase接入Google登录 开启Firebase的登录方式 问题小结 Google登录代码 调用登录代码 参考文章: 此文章只是粗浅之作,记录而已,有错望指出,不胜感激 开启Fi ...
- [Android/安卓]Google登录接口之Api接入
目录 1.基础配置 2.GoogleLogInImpl(登录接口实现类) 3.GoogleLogIn(实现类接口) 4.GoogleCallback(登录授权回调接口) 5.GoogleBuild(构 ...
最新文章
- Workbench Could not connect the SSH Tunnel Authentication error
- jstack 使用(转)
- golang rpc的两种调用方法
- CV:基于深度学习实现目标检测之GUI界面产品设计并实现图片识别、视频识别、摄像头识别(准确度非常高)
- Python基础:常用知识点汇总
- UVM入坑系列笔记(一)
- 让ECSHOP模板支持转smarty时间戳
- NBear的优缺点粗略分析(3.7版本)-- NB之一
- [python高德]行政区查询、调用wbe服务api获取省、市、区经纬度信息
- VS Code 运行时会弹出Unins000.Exe目标目录创建文件错误
- 认识 Iconfont 以及什么是 .eot、.woff、.ttf、.svg
- 微信小游戏 - Canvas/WebGL Demo 移植
- ArcMap常用1:地理配准(一张地图图片和gis地图的匹配)
- 《如师通语言学习软件(罗塞塔石碑)》(Rosetta Stone) v3.4.5 英语/日语/法语/德语/韩语/俄语/西班牙语/意大利语/阿拉伯语/葡萄牙语/汉语 [云端免安装版]
- Python第三方库之MedPy
- Mr.Xiong使用jQuery从控制器获取数据
- 解决HbuilderX拒绝访问页面的问题
- 程序人生 - 车险到底哪家好、怎么选?三巨头对比,让你一目了然
- UIStoryboardSegue(多控制器)
- HDU - 1217 Arbitrage [最短路]
热门文章
- 发展5G通信,测试先行
- 适用于任何设备的屏幕共享应用程序 – Mirroring360
- matlab 插入标尺,Matlab如何设置自定义的画图标尺scale
- 基于FFmpeg的Java视频Mp4转GIF初探
- 软件测试阶段划分以及测试分类
- SAP FICO 会计凭证打印开发说明书(包括开发源代码、测试样例及FS)
- python os.path.splitext()的用法_Python中os.path用法分析
- 星星之火-52:6G十大领域关键技术
- Paste Image插件初始化设置:修改图片保存路径、自动插入图片描述信息
- 《计算机网络自顶向下》 Miscellaneous Lab1 Implementing a Reliable Transport Protocol(实现可靠的传输协议(上))