Introduction to
JustAuth: special thanks JustAuth here open source project, the author provides architecture thinking (especially most of the Readme from JustAuth, I compare lazy)
CollectiveOAuth.net platform, it is only a tool for a third party authorization login class libraries, it can make us from tedious third-party login SDK, make the login So easy!
Open source address of the project: Gitee (https://gitee.com/rthinking/CollectiveOAuth)
Document of the project: reference documentation (https://codoc.rthinkingsoft.cn)
Characteristics of #
Nonsense not say, just two words:
: as a whole has integrated more than a dozen third-party platform () is included in the basic are commonly used at home and abroad, is still in the continuous extension ([development plan (production)]!
Jane: API is running with the most simple to design (see the back quickly start), as far as possible let you no obstacle to use
Quick start
Configure authorization information (the default configuration in webconfig, can transform storage database or any other place)
& lt; ! No. - Demo: WeChat service authorization configuration - & gt;
& lt; The add key="CollectiveOAuth_WECHAT_MP_ClientId" value="https://bbs.csdn.net/topics/wxer6785660834656"/& gt;
& lt; The add key="CollectiveOAuth_WECHAT_MP_ClientSecret" value="https://bbs.csdn.net/topics/98967867678678678546434345344"/& gt;
& lt; The add key="CollectiveOAuth_WECHAT_MP_Scope" value="https://bbs.csdn.net/topics/snsapi_userinfo"/& gt;
& lt; The add key="CollectiveOAuth_WECHAT_MP_RedirectUri" value="HTTP://https://yours.domain.com/oauth2/callback? AuthSource=WECHAT_MP "/& gt;
Call API
//create the authorization request
Var clientConfig=new clientConfig ();
ClientConfig. ClientId=AppSettingUtils. GetStrValue ($" CollectiveOAuth_XXXXXX_ClientId ");
ClientConfig. ClientSecret=AppSettingUtils. GetStrValue ($" CollectiveOAuth_XXXXXX_ClientSecret ");
ClientConfig. RedirectUri=AppSettingUtils. GetStrValue ($" CollectiveOAuth_XXXXXX_RedirectUri ");
ClientConfig. Scope=AppSettingUtils. GetStrValue ($" CollectiveOAuth_XXXXXX_Scope ");
AuthRequest AuthRequest=new GiteeAuthRequest (clientConfig);
//generated authorization page
AuthRequest. The authorize (" state ");
//authorization will return after the login code (auth_code (paypal only)), the state, can use AuthCallback class as a callback interface parameter
//note: CollectiveOAuth default save state lasting for five minutes, five minutes is not used the state will automatically expire
AuthRequest. Login (the callback);
CodePudding user response:
The first praise! !CodePudding user response:
Don't have a fart to use, over the wall?CodePudding user response: