openid

微信小程序通过getPhoneNumber后台PHP解密获取用户手机号码

╄→гoц情女王★ 提交于 2021-01-31 05:32:57
之前做的版本用户这块是以获取用户openid为凭证,最近改版重新整理了一下,新增注册登录以手机号码为主, 两种(正常注册手机号码-密码+一键获取当前用户手机号码) getPhoneNumber这个组件要通过button来实现。将button中的open-type=“getPhoneNumber”,并且绑定bindgetphonenumber事件获取回调。 在使用这个组件之前必须先调用 login 接口 然后传递code,iv,encryptedData参数到后台,后台解密 示例 <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" hover-class="none">一键自动注册</button>    getPhoneNumber: function (e) { console.log(e.detail.errMsg) if (e.detail.errMsg == 'getPhoneNumber:fail user deny') { wx.showModal({ title: '提示', showCancel: false, content: '未授权', success: function (res) { } }) } else { wx.login({ success: function

Microsoft identity platform and OAuth 2.0 authorization code flow error 400 Bad Request

自闭症网瘾萝莉.ら 提交于 2021-01-29 22:00:41
问题 I need a bit of help understanding which is the problem with Microsoft Identity Platform login on my cms (ASP.NET Webforms). It used to work without problems, last time I tried was maybe a month ago. Now I'm receiving a "400 bad request" response on the second step of the code flow authentication, when I send back the authorization_code that I received after the user login to the token endpoint, to request the access_token. The original GET request to send the user to the Microsoft login

Microsoft identity platform and OAuth 2.0 authorization code flow error 400 Bad Request

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 17:22:23
问题 I need a bit of help understanding which is the problem with Microsoft Identity Platform login on my cms (ASP.NET Webforms). It used to work without problems, last time I tried was maybe a month ago. Now I'm receiving a "400 bad request" response on the second step of the code flow authentication, when I send back the authorization_code that I received after the user login to the token endpoint, to request the access_token. The original GET request to send the user to the Microsoft login

How to dynamically change OpenID configuration based on something in a single ASP.NET Core application?

青春壹個敷衍的年華 提交于 2021-01-29 10:02:27
问题 We have some OpenID configuration specified in ConfigureServices in Startup.cs : services.AddOpenIdConnect("something", "Something", options => { // ... // }); How can we change the configuration we've outlined here dynamically, on a per request basis, based on certain rules? Can this be done in a middleware? If so, please give an example, thank you! 回答1: Don't think you can do that, but you can if you want add multiple services.AddOpenIdConnect(...) handlers and use a different one for

Redirecting user to default page after login in ASP.NET Core using Okta

坚强是说给别人听的谎言 提交于 2021-01-28 13:42:38
问题 I am using Okta for authentication in my ASP.NET Core application. After login, I would like to redirect the user to a different page, but I cannot find where to configure this. In ConfigureServices: services.AddAuthentication(sharedOptions => { sharedOptions.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults

Identity server does not redirect after sucessfull login

夙愿已清 提交于 2021-01-28 01:46:13
问题 I am trying to set up IdentityServer4 with MVC client. Everything works fine until I want to add ASP Identity. When I added code to use SQL server and Identity, after sucessfull login Identity server does not redirects me back to my client, but it just "refreshes" the page. IdentityServer app startup: public class Startup { public IWebHostEnvironment Environment { get; } public IConfiguration Configuration { get; } public Startup(IWebHostEnvironment environment, IConfiguration configuration)

记录一次一对多查询优化

ⅰ亾dé卋堺 提交于 2021-01-27 12:19:07
记录一次一对多查询优化 第一张表 cs_user,用户表,假设数据有300+条 CREATE TABLE `cs_user` ( `id` int ( 11 ) NOT NULL AUTO_INCREMENT , `code` text NOT NULL , `openid` text NOT NULL , `nickname` varchar ( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '名称' , `city` varchar ( 255 ) NOT NULL COMMENT '市' , `province` varchar ( 255 ) NOT NULL COMMENT '省' , `country` varchar ( 255 ) NOT NULL COMMENT '国家' , `headimgurl` text NOT NULL COMMENT '头像' , `subscribe_time` int ( 11 ) NOT NULL , `u_time` int ( 11 ) NOT NULL , `l_time` int ( 11 ) NOT NULL , `remark` varchar ( 100 ) DEFAULT NULL COMMENT '备注名' , `user

Get current authentication scheme in ASP.NET core 2

半世苍凉 提交于 2021-01-26 10:39:32
问题 I am currently struggling with an Asp.net core 2 application which uses two openid providers for authentication, mapped to two different Authentication Schemes (with different names). The problem I am facing is trying to logout of the specific scheme that is currently being used. For example, if I support both Google and Facebook authentication, I need to understand which scheme is currently being used, and call the SignOut method indicating the correct scheme. This allows me to clear the

Get current authentication scheme in ASP.NET core 2

余生长醉 提交于 2021-01-26 10:35:23
问题 I am currently struggling with an Asp.net core 2 application which uses two openid providers for authentication, mapped to two different Authentication Schemes (with different names). The problem I am facing is trying to logout of the specific scheme that is currently being used. For example, if I support both Google and Facebook authentication, I need to understand which scheme is currently being used, and call the SignOut method indicating the correct scheme. This allows me to clear the

微信支付JSAPI支付

坚强是说给别人听的谎言 提交于 2021-01-26 08:23:12
1.介绍 JSAPI支付是用户在微信中打开商户的H5页面,商户在H5页面通过调用微信支付提供的JSAPI接口调起微信支付模块完成支付。 应用场景有: ◆ 用户在微信公众账号内进入商家公众号,打开某个主页面,完成支付 ◆ 用户的好友在朋友圈、聊天窗口等分享商家页面连接,用户点击链接打开商家页面,完成支付 ◆ 将商户页面转换成二维码,用户扫描二维码后在微信浏览器中打开页面后完成支付  JSAPI支付只能用微信浏览器打开 2.商户号配置   在微信商户平台(pay.weixin.qq.com)设置您的JSAPI支付支付目录,设置路径:商户平台-->产品中心-->开发配置   JSAPI支付在请求支付的时候会校验请求来源是否有在商户平台做了配置,所以必须确保支付目录已经正确的被配置,否则将验证失败, 请求支付不成功。 3.在微信公众平台设置授权域名 开发JSAPI支付时,在统一下单接口中要求必传用户openid,而获取openid则需要您在公众平台设置获取openid的域名 只有被设置过的域名才是一个有效的获取openid的域名,否则将获取失败。 注:使用微信jsapi支付必须先配置好以上信息,不然开发过程成中会有很多页面错误提示报错,为了避免,先配置好所需要的信息, 网页授权域名是用来向微信获取code 4.微信网页授权 如果用户在微信客户端中访问第三方网页