aspnet-contrib / AspNet.Security.OAuth.Providers

OAuth 2.0 social authentication providers for ASP.NET Core
Apache License 2.0
2.38k stars 538 forks source link

Weixin use qrcode login #802

Closed snowchenlei closed 1 year ago

snowchenlei commented 1 year ago

for AspNet.Security.OAuth.Weixin: Wechat_Login i need Instantiate the following JS object where you need to use Weixin login. but i don't have state. will weixin redirect to '/signin-weixin' will get error 'The oauth state was missing or invalid.'.how to get/set state

kevinchalet commented 1 year ago

Starting the authorization flow browser-side via JS is not a supported scenario in any of the providers. The authorization dance MUST be initiated by the ASP.NET Core app for things to work correctly.

snowchenlei commented 1 year ago

Starting the authorization flow browser-side via JS is not a supported scenario in any of the providers. The authorization dance MUST be initiated by the ASP.NET Core app for things to work correctly.

The page where qrcode is located is a razor page ASP.NET Core. Can you manually get/set the state in the OnGet method of the *.cs code?