openid

微信小程序,调用建行支付。

痴心易碎 提交于 2020-08-04 12:46:19
由于微信支付费率是千分之六,在得知道建行龙支付可以做到千分之二,公司在成本这块就果断采取接建行,废话不说了直接贴代码 Service 层 相关的参数要求还得细对建行的文档 @Service public class CCBPayServiceImpl implements CCBPayApi { private static final Logger LOGGER = LoggerFactory.getLogger(CCBPayServiceImpl. class ); @Override public PayResult cCBPayment(PayRequestInfo payRequestInfo) throws BizException { BigDecimal orderPrice = TypeConversionUtil.getBigDecimal(payRequestInfo.getOrderPrice()); HashMap <String, String> map = new HashMap<String, String> (); map.put( "MERCHANTID" , CCBConstants.MERCHANTID); map.put( "POSID" , CCBConstants.POSID); map.put( "BRANCHID" ,

微信小程序,调用建行支付。

寵の児 提交于 2020-08-04 12:01:29
由于微信支付费率是千分之六,在得知道建行龙支付可以做到千分之二,公司在成本这块就果断采取接建行,废话不说了直接贴代码 Service 层 相关的参数要求还得细对建行的文档 @Service public class CCBPayServiceImpl implements CCBPayApi { private static final Logger LOGGER = LoggerFactory.getLogger(CCBPayServiceImpl. class ); @Override public PayResult cCBPayment(PayRequestInfo payRequestInfo) throws BizException { BigDecimal orderPrice = TypeConversionUtil.getBigDecimal(payRequestInfo.getOrderPrice()); HashMap <String, String> map = new HashMap<String, String> (); map.put( "MERCHANTID" , CCBConstants.MERCHANTID); map.put( "POSID" , CCBConstants.POSID); map.put( "BRANCHID" ,

How do i implement ‘sign in with google’ on my site?

拥有回忆 提交于 2020-07-31 06:25:11
问题 On my site I would like to allow users to sign in with a google account. I plan to use openid but I would like to allow signing in with google because it has more benefits. I've noticed in the past a few sites that have the ability to sign in with a google (gmail) account and IIRC though they did NOT support openID (but I could be wrong). How do I implement 'sign in with google' ? 回答1: If you plan to use OpenID, use that. Google is already an OpenID 2.0 provider. Google's OpenID provider is

微信公众号本地开发流程

我只是一个虾纸丫 提交于 2020-07-29 06:25:50
1.建立测试号 直接打开链接,微信扫码登录即可测试号管理页面 https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index ,如下图所示 2.在测试号中的【网 页授权 获取用户基本信息】中,设置回调地址IP( localhost,127.0.0.1均不能使用,请使用局域网IP或域名,测试 号回调地址支持域名和ip,正式公众号回调地址只支持域名。 ) 3.下载微信开发者工具,选择公众号网页开发 4.填写要测试的地址,修改 rediect_uri 回调地址, 访问腾讯服务器url规则如下: https://open.weixin.qq.com/connect/oauth2/authorize?appid= 你当前测试号的 appid &redirect_uri= 你的接口路径 ( 记得 uri 码 ) &response_type=code&scope=snsapi_userinfo#wechat_redirect 5.访问以上地址的话,微信服务器会转发到另一个地址,地址中包含code,可以通过code获取到用户的openId(openId是微信用户唯一凭证) 例如:http://www.baidu.com/spic&code

小程序和公众号openID绑定

依然范特西╮ 提交于 2020-07-28 12:39:39
通过小程序登录获取小程序openID <button hidden="{{is_login}}" class='bottom' type='primary' open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="bindGetUserInfo" style='width:100px'> 登录</button> bindGetUserInfo: function (e) { if (e.detail.userInfo) { //用户按了允许授权按钮 var that = this; //插入登录的用户的相关信息到数据库 var openid = getApp().globalData.openid; var session = getApp().globalData.session getApp().globalData.userInfo = e.detail.userInfo; //通过wx.login获取code 想要获取用户信息,必须登录 wx.login({     success: function(res){       if(res.code){ var code = res.code; // 获取 encryptedData iv wx.getUserInfo({ withCredentials: true,

微信公众号本地开发流程

孤街醉人 提交于 2020-07-28 04:57:46
1.建立测试号 直接打开链接,微信扫码登录即可测试号管理页面 https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index ,如下图所示 2.在测试号中的【网 页授权 获取用户基本信息】中,设置回调地址IP( localhost,127.0.0.1均不能使用,请使用局域网IP或域名,测试 号回调地址支持域名和ip,正式公众号回调地址只支持域名。 ) 3.下载微信开发者工具,选择公众号网页开发 4.填写要测试的地址,修改 rediect_uri 回调地址, 访问腾讯服务器url规则如下: https://open.weixin.qq.com/connect/oauth2/authorize?appid= 你当前测试号的 appid &redirect_uri= 你的接口路径 ( 记得 uri 码 ) &response_type=code&scope=snsapi_userinfo#wechat_redirect 5.访问以上地址的话,微信服务器会转发到另一个地址,地址中包含code,可以通过code获取到用户的openId(openId是微信用户唯一凭证) 例如:http://www.baidu.com/spic&code

第十节:IdentityServer4隐式模式介绍和代码实操演练

左心房为你撑大大i 提交于 2020-07-27 08:40:29
一. 前言 1.简介   简化模式(implicit grant type)不通过第三方应用程序的服务器,直接在浏览器中向认证服务器申请令牌,步骤在浏览器中完成,令牌对访问者是可见的,且客户端不需要认证。 注:该模式也有很大的弊端,就是请求令牌在浏览器中能被看到。 2. 流程图 流程 (A)客户端将用户导向认证服务器。 (B)用户决定是否给于客户端授权。 (C)假设用户给予授权,认证服务器将用户导向客户端指定的"重定向URI",并在URI的Hash部分包含了访问令牌。 (D)浏览器向资源服务器发出请求,其中不包括上一步收到的Hash值(#号的部分)。 (E)资源服务器返回一个网页,其中包含的代码可以获取Hash值中的令牌。 (F)浏览器执行上一步获得的脚本,提取出令牌。 (G)浏览器将令牌发给客户端。 (H)客户端拿到令牌以后,就可以去请求资源服务器获取资源了。 3. 流程剖析 步骤A: 导向认证服务器,如下请求,进而再导向认证服务器的登录页面。 GET /authorize?response_type=token&client_id=s6BhdRkqt3&state=xyz&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb 参数包括:   response_type:表示授权类型,此处的值固定为"token",必选项。

第五节:IdentityServer4的Pkce机制、令牌刷新机制、混合授权模式

独自空忆成欢 提交于 2020-07-26 23:59:31
一. PKCE机制 1. 准备 (1). IDS4_Server1:认证授权服务器 (2). MvcClient1:web客户端  然后将上述两个项目配置成授权码模式(如何配置见上一节 IdentityServer4授权码模式介绍和代码实操演练 ) PS: PKCE机制是在授权码模式的基础上,增加了几个验证参数,使其更加安全。 2. 代码配置 (1).IDS4_Server1中的Config1,新增 RequirePkce = true, 开启Pkce授权校验。 (2).MvcClient1中的ConfigureServices中, 新增options.UsePkce = true;开启Pkce. (默认就是true,所以可以省略) PS:实际上在上一节的授权码模式中已经开启了pkce,只是没有单独点明增加的参数的含义。 3. 剖析测试 (1).在导向认证服务器的请求和确认授权页面的请求中,新增两个参数:code_challenge 和 code_challenge_method. (2).客户端携带授权码请求认证服务器的时候,携带的参数中新增: code_verifier 二. 令牌刷新机制 1. 准备 (1). IDS4_Server1:认证授权服务器 (2). MvcClient1:web客户端  然后将上述两个项目配置成授权码模式(如何配置见上一节

微信小程序支付C#后端源码

蹲街弑〆低调 提交于 2020-07-24 03:06:46
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Web; 6 using System.Web.Mvc; 7 using System.IO; 8 using System.Security.Cryptography; 9 using System.Text; 10 using System.Xml; 11 using Newtonsoft.Json; 12 using Newtonsoft.Json.Linq; 13 namespace Mvc_vue.Controllers 14 { 15 public class wxController : Controller 16 { 17 // 18 // GET: /wx/ 19 20 public ActionResult Index() 21 { 22 return View(); 23 } 24 // 所需值 25 public static string _appid = " wxd930ea5d5a258f4f " ; 26 public static string _mch_id = " 10000100 " ; 27 public static

AWS Cognito attributes OpenID

天大地大妈咪最大 提交于 2020-07-10 07:46:55
问题 I'm trying to login in Cognito via another OAuth. I added OIDC provider to Cognito Userpool. I setup attribute mappings for this new OIDC "email" -> "Email". In attributes permissions are all permission checked for read and also write. I can successfully log in through cognito via this OIDC, but there is no attribute email in user. Any idea why ? I tried manually hit user info endpoint with access token and in response there is email. I dont know why Cognito is not able to get it. I tried