oauth

How does Google Sign in for Android work without a redirect uri?

允我心安 提交于 2020-04-18 05:36:16
问题 The Google Sign in library on Android works without specifying any redirect uri. Why is this the case? To which endpoint does Google send the access code to after the user logs in? And how does it redirect the user back to the app? Thanks. 回答1: Now I see, the redirect uri is in fact the app itself, using a uri that points to a page on the app, not to any website. The redirect uri can be set up in the Android app by using the information here: https://developer.android.com/training/app-links

IdentityServer4源码解析_4_令牌发放接口

三世轮回 提交于 2020-04-17 04:23:43
【推荐阅读】微服务还能火多久?>>> 目录 IdentityServer4源码解析_1_项目结构 IdentityServer4源码解析_2_元数据接口 IdentityServer4源码解析_3_认证接口 IdentityServer4源码解析_4_令牌发放接口 IdentityServer4源码解析_5_查询用户信息接口 [IdentityServer4源码解析_6_结束会话接口] [IdentityServer4源码解析_7_查询令牌信息接口] [IdentityServer4源码解析_8_撤销令牌接口] 协议 Token接口 oidc服务需要提供token接口,提供AccessToken,IdToken,以及RefreshToken(可选)。在授权码模式下,token接口必须使用https。 请求 必须使用POST方法,使用x-www-form-urlencoded序列化参数,clientId:clientSecret使用Basic加密放在Authorization头中 POST /token HTTP/1.1 Host: server.example.com Content-Type: application/x-www-form-urlencoded Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW grant_type

IdentityServer4源码解析_1_项目结构

拟墨画扇 提交于 2020-04-17 03:58:36
【推荐阅读】微服务还能火多久?>>> 目录 IdentityServer4源码解析_1_项目结构 IdentityServer4源码解析_2_元数据接口 IdentityServer4源码解析_3_认证接口 IdentityServer4源码解析_4_令牌发放接口 IdentityServer4源码解析_5_查询用户信息接口 [IdentityServer4源码解析_6_结束会话接口] [IdentityServer4源码解析_7_查询令牌信息接口] [IdentityServer4源码解析_8_撤销令牌接口] 简介 Security源码解析系列介绍了微软提供的各种认证架构,其中OAuth2.0,OpenIdConnect属于远程认证架构,所谓远程认证,是指token的颁发是由其他站点完成的。 IdentityServer4是基于OpenIdConnect协议的认证中心框架,可以帮助我们快速搭建微服务认证中心。 初学者可能看到生涩的概念比较头疼,可以将OAuth, OpenIdConnect协议简单理解成需求文档,idsv4基于需求提供了一系列的api实现。 对于idsv还不太了解的可以看下面的资料,本系列主要学习梳理idsv4的源码,结合协议加深理解。 晓晨姐姐系列文章 https://www.cnblogs.com/stulzq/p/8119928.html 官方文档

AspNetCore3.1_Secutiry源码解析_5_Authentication_OAuth

好久不见. 提交于 2020-04-17 03:36:20
【推荐阅读】微服务还能火多久?>>> 文章目录 AspNetCore3.1_Secutiry源码解析_1_目录 AspNetCore3.1_Secutiry源码解析_2_Authentication_核心项目 AspNetCore3.1_Secutiry源码解析_3_Authentication_Cookies AspNetCore3.1_Secutiry源码解析_4_Authentication_JwtBear AspNetCore3.1_Secutiry源码解析_5_Authentication_OAuth AspNetCore3.1_Secutiry源码解析_6_Authentication_OpenIdConnect AspNetCore3.1_Secutiry源码解析_7_Authentication_其他 AspNetCore3.1_Secutiry源码解析_8_Authorization_授权框架 OAuth简介 现在随便一个网站,不用注册,只用微信扫一扫,然后就可以自动登录,然后第三方网站右上角还出现了你的微信头像和昵称,怎么做到的? <div class="mermaid"> sequenceDiagram 用户->>x站点: 请求微信登录 x站点->>微信: 请求 oauth token 微信->>用户: x站点请求基本资料权限,是否同意? 用户->>微信:

AspNetCore3.1_Secutiry源码解析_6_Authentication_OpenIdConnect

耗尽温柔 提交于 2020-04-17 03:36:02
【推荐阅读】微服务还能火多久?>>> 文章目录 AspNetCore3.1_Secutiry源码解析_1_目录 AspNetCore3.1_Secutiry源码解析_2_Authentication_核心项目 AspNetCore3.1_Secutiry源码解析_3_Authentication_Cookies AspNetCore3.1_Secutiry源码解析_4_Authentication_JwtBear AspNetCore3.1_Secutiry源码解析_5_Authentication_OAuth AspNetCore3.1_Secutiry源码解析_6_Authentication_OpenIdConnect AspNetCore3.1_Secutiry源码解析_7_Authentication_其他 AspNetCore3.1_Secutiry源码解析_8_Authorization_授权框架 oidc简介 oidc是基于oauth2.0的上层协议。 OAuth有点像卖电影票的,只关心用户能不能进电影院,不关心用户是谁。而oidc则像身份证,扫描就可以上飞机,一次扫描,机场不仅能知道你是否能上飞机,还可以知道你的身份信息。 oidc兼容OAuth2.0, 可以实现跨顶级域的SSO(单点登录、登出)

AspNetCore3.1_Secutiry源码解析_8_Authorization_授权框架

筅森魡賤 提交于 2020-04-17 03:35:23
【推荐阅读】微服务还能火多久?>>> 文章目录 AspNetCore3.1_Secutiry源码解析_1_目录 AspNetCore3.1_Secutiry源码解析_2_Authentication_核心项目 AspNetCore3.1_Secutiry源码解析_3_Authentication_Cookies AspNetCore3.1_Secutiry源码解析_4_Authentication_JwtBear AspNetCore3.1_Secutiry源码解析_5_Authentication_OAuth AspNetCore3.1_Secutiry源码解析_6_Authentication_OpenIdConnect AspNetCore3.1_Secutiry源码解析_7_Authentication_其他 AspNetCore3.1_Secutiry源码解析_8_Authorization_授权框架 简介 开篇提到过,认证主要解决的是who are you,授权解决的是 are you allowed的问题。各种认证架构可以帮我们知道用户身份(claims),oauth等架构的scope字段能够控制api服务级别的访问权限,但是更加细化和多变的功能授权不是它们的处理范围。 微软的Authorization项目提供了基于策略的灵活的授权框架。 推荐看下面博客了解

AspNetCore3.1_Secutiry源码解析_2_Authentication_核心对象

泪湿孤枕 提交于 2020-04-17 02:58:08
【推荐阅读】微服务还能火多久?>>> 文章目录 AspNetCore3.1_Secutiry源码解析_1_目录 AspNetCore3.1_Secutiry源码解析_2_Authentication_核心项目 AspNetCore3.1_Secutiry源码解析_3_Authentication_Cookies AspNetCore3.1_Secutiry源码解析_4_Authentication_JwtBear AspNetCore3.1_Secutiry源码解析_5_Authentication_OAuth AspNetCore3.1_Secutiry源码解析_6_Authentication_OpenIdConnect AspNetCore3.1_Secutiry源码解析_7_Authentication_其他 AspNetCore3.1_Secutiry源码解析_8_Authorization_授权框架 依赖注入 框架提供了三个依赖注入重载方法。 //注入认证服务 services.AddAuthentication(); //注入认证服务并制定默认架构名 services.AddAuthentication("Cookies"); //注入认证服务并设置配置项 services.AddAuthentication(config => { }); 看看注入代码 public

How to pass code_challenge and code_verifier for Snapchat API

孤人 提交于 2020-04-16 02:33:18
问题 I have tried absolutely everything to get the code_verifier to work, to no avail. Everything else seems to be fine. In the code sample provided (PHP), my first method (get_snapchat_auth_url() ) creates the authentication URL. That seems to work fine and it generates a callback URL with a code and a state. Then the second method (get_access_token() ) is called with the code passed to it as a parameter. This also seems to work fine. It constructs the header and fields using my app's callback

基于oauth 2.0 实现第三方开放平台

筅森魡賤 提交于 2020-04-14 04:14:52
【今日推荐】:为什么一到面试就懵逼!>>> 本文单纯从简单的技术实现来讲,不涉及开放平台的多维度的运营理念。 什么是开放平台 通过开放自己平台产品服务的各种API接口,让其他第三方开发者在开发应用时根据需求直接调用,例如微信登录、QQ登录、微信支付、微博登录、热门等。 让第三方应用通过开发平台,使得自身海量数据资源得到沉淀(变现) 目前国内主流的网站的的开放平台,都是基于oauth2.0 协议进行做的开放平台 微信开放平台授权机制流程图 微博开放平台授权机制流程图 oauth2.0 授权码模式 授权码模式(authorization code)是功能最完整、流程最严密的授权模式。 它的特点就是通过客户端的后台服务器,与"服务提供商"的认证服务器进行互动,能够满足绝大多数开放平台认证授权的需求。 引入相关依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-oauth2</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-security</artifactId> <

Spring 2.0.4中使用OAuth2.0认证

♀尐吖头ヾ 提交于 2020-04-13 17:07:48
【今日推荐】:为什么一到面试就懵逼!>>> 问题 最近有个需求是要给系统里面的所有REST请求,弄一个token,然后,那着这个访问token,去掉接口。阮一峰写了两遍文章,值得我们一看: RESTful API 设计指南 理解OAuth 2.0 这里假设我们已经实现spring的rest api了。 Maven <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> ... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.security.oauth.boot</groupId> <artifactId>spring-security-oauth2