update 优化 !pr382 修复一些问题 完事流程逻辑
| | |
| | | } |
| | | AuthRequest authRequest = SocialUtils.getAuthRequest(source, socialProperties); |
| | | String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); |
| | | return R.ok(authorizeUrl); |
| | | return R.ok("操作成功", authorizeUrl); |
| | | } |
| | | |
| | | /** |
| | |
| | | --- # 三方授权 |
| | | justauth: |
| | | enabled: true |
| | | address: http://localhost:80 |
| | | type: |
| | | qq: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=qq |
| | | redirect-uri: ${justauth.address}/social-callback?source=qq |
| | | union-id: false |
| | | weibo: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=weibo |
| | | redirect-uri: ${justauth.address}/social-callback?source=weibo |
| | | gitee: |
| | | client-id: 914******************98 |
| | | client-secret: 02*****************ac |
| | | redirect-uri: http://localhost:80/social-login?source=gitee |
| | | redirect-uri: ${justauth.address}/social-callback?source=gitee |
| | | dingtalk: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=dingtalk |
| | | redirect-uri: ${justauth.address}/social-callback?source=dingtalk |
| | | baidu: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=baidu |
| | | redirect-uri: ${justauth.address}/social-callback?source=baidu |
| | | csdn: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=csdn |
| | | redirect-uri: ${justauth.address}/social-callback?source=csdn |
| | | coding: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=coding |
| | | redirect-uri: ${justauth.address}/social-callback?source=coding |
| | | coding-group-name: xx |
| | | oschina: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=oschina |
| | | redirect-uri: ${justauth.address}/social-callback?source=oschina |
| | | alipay: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=alipay |
| | | redirect-uri: ${justauth.address}/social-callback?source=alipay |
| | | alipay-public-key: MIIB**************DAQAB |
| | | wechat_open: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=wechat_open |
| | | redirect-uri: ${justauth.address}/social-callback?source=wechat_open |
| | | wechat_mp: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=wechat_mp |
| | | redirect-uri: ${justauth.address}/social-callback?source=wechat_mp |
| | | wechat_enterprise: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=wechat_enterprise |
| | | redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise |
| | | agent-id: 1000002 |
| | | gitlab: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=gitlab |
| | | redirect-uri: ${justauth.address}/social-callback?source=gitlab |
| | |
| | | --- # 三方授权 |
| | | justauth: |
| | | enabled: true |
| | | address: http://localhost:80 |
| | | type: |
| | | qq: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=qq |
| | | redirect-uri: ${justauth.address}/social-callback?source=qq |
| | | union-id: false |
| | | weibo: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=weibo |
| | | redirect-uri: ${justauth.address}/social-callback?source=weibo |
| | | gitee: |
| | | client-id: 914******************98 |
| | | client-secret: 02*****************ac |
| | | redirect-uri: http://localhost:80/social-login?source=gitee |
| | | redirect-uri: ${justauth.address}/social-callback?source=gitee |
| | | dingtalk: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=dingtalk |
| | | redirect-uri: ${justauth.address}/social-callback?source=dingtalk |
| | | baidu: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=baidu |
| | | redirect-uri: ${justauth.address}/social-callback?source=baidu |
| | | csdn: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=csdn |
| | | redirect-uri: ${justauth.address}/social-callback?source=csdn |
| | | coding: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=coding |
| | | redirect-uri: ${justauth.address}/social-callback?source=coding |
| | | coding-group-name: xx |
| | | oschina: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=oschina |
| | | redirect-uri: ${justauth.address}/social-callback?source=oschina |
| | | alipay: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=alipay |
| | | redirect-uri: ${justauth.address}/social-callback?source=alipay |
| | | alipay-public-key: MIIB**************DAQAB |
| | | wechat_open: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=wechat_open |
| | | redirect-uri: ${justauth.address}/social-callback?source=wechat_open |
| | | wechat_mp: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=wechat_mp |
| | | redirect-uri: ${justauth.address}/social-callback?source=wechat_mp |
| | | wechat_enterprise: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=wechat_enterprise |
| | | redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise |
| | | agent-id: 1000002 |
| | | gitlab: |
| | | client-id: 10**********6 |
| | | client-secret: 1f7d08**********5b7**********29e |
| | | redirect-uri: http://localhost:80/social-login?source=gitlab |
| | | redirect-uri: ${justauth.address}/social-callback?source=gitlab |
| | |
| | | case "coding" -> new AuthCodingRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build()); |
| | | case "oschina" -> new AuthOschinaRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build()); |
| | | // 支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1,所以这儿的回调地址使用的局域网内的ip |
| | | // 使用支付宝需要提供alipay公钥 |
| | | // case "alipay" -> new AuthAlipayRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build(), alipayPublicKey); |
| | | case "alipay" -> new AuthAlipayRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build(), socialProperties.getType().get("alipay").getAlipayPublicKey()); |
| | | case "qq" -> new AuthQqRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build()); |
| | | case "wechat_open" -> new AuthWeChatOpenRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build()); |
| | | case "taobao" -> new AuthTaobaoRequest(AuthConfig.builder().clientId(clientId).clientSecret(clientSecret).redirectUri(redirectUri).build()); |
| | |
| | | comment on column sys_social.id is '主键'; |
| | | comment on column sys_social.user_id is '用户ID'; |
| | | comment on column sys_social.tenant_id is '租户id'; |
| | | comment on column sys_social.auth_id is '授权+授权openid'; |
| | | comment on column sys_social.auth_id is '平台+平台唯一id'; |
| | | comment on column sys_social.source is '用户来源'; |
| | | comment on column sys_social.open_id is '原生openid'; |
| | | comment on column sys_social.open_id is '平台编号唯一id'; |
| | | comment on column sys_social.user_name is '登录账号'; |
| | | comment on column sys_social.nick_name is '用户昵称'; |
| | | comment on column sys_social.email is '用户邮箱'; |
| | |
| | | comment on column sys_social.id is '主键'; |
| | | comment on column sys_social.user_id is '用户ID'; |
| | | comment on column sys_social.tenant_id is '租户id'; |
| | | comment on column sys_social.auth_id is '授权+授权openid'; |
| | | comment on column sys_social.auth_id is '平台+平台唯一id'; |
| | | comment on column sys_social.source is '用户来源'; |
| | | comment on column sys_social.open_id is '原生openid'; |
| | | comment on column sys_social.open_id is '平台编号唯一id'; |
| | | comment on column sys_social.user_name is '登录账号'; |
| | | comment on column sys_social.nick_name is '用户昵称'; |
| | | comment on column sys_social.email is '用户邮箱'; |
| | |
| | | 'COLUMN', N'tenant_id' |
| | | GO |
| | | EXEC sys.sp_addextendedproperty |
| | | 'MS_Description', N'授权+授权openid' , |
| | | 'MS_Description', N'平台+平台唯一id' , |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'sys_social', |
| | | 'COLUMN', N'auth_id' |
| | |
| | | 'COLUMN', N'source' |
| | | GO |
| | | EXEC sys.sp_addextendedproperty |
| | | 'MS_Description', N'原生openid' , |
| | | 'MS_Description', N'平台编号唯一id' , |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'sys_social', |
| | | 'COLUMN', N'open_id' |
| | |
| | | comment on column sys_social.id is '主键'; |
| | | comment on column sys_social.user_id is '用户ID'; |
| | | comment on column sys_social.tenant_id is '租户id'; |
| | | comment on column sys_social.auth_id is '授权+授权openid'; |
| | | comment on column sys_social.auth_id is '平台+平台唯一id'; |
| | | comment on column sys_social.source is '用户来源'; |
| | | comment on column sys_social.open_id is '原生openid'; |
| | | comment on column sys_social.open_id is '平台编号唯一id'; |
| | | comment on column sys_social.user_name is '登录账号'; |
| | | comment on column sys_social.nick_name is '用户昵称'; |
| | | comment on column sys_social.email is '用户邮箱'; |
| | |
| | | comment on column sys_social.id is '主键'; |
| | | comment on column sys_social.user_id is '用户ID'; |
| | | comment on column sys_social.tenant_id is '租户id'; |
| | | comment on column sys_social.auth_id is '授权+授权openid'; |
| | | comment on column sys_social.auth_id is '平台+平台唯一id'; |
| | | comment on column sys_social.source is '用户来源'; |
| | | comment on column sys_social.open_id is '原生openid'; |
| | | comment on column sys_social.open_id is '平台编号唯一id'; |
| | | comment on column sys_social.user_name is '登录账号'; |
| | | comment on column sys_social.nick_name is '用户昵称'; |
| | | comment on column sys_social.email is '用户邮箱'; |
| | |
| | | 'COLUMN', N'tenant_id' |
| | | GO |
| | | EXEC sys.sp_addextendedproperty |
| | | 'MS_Description', N'授权+授权openid' , |
| | | 'MS_Description', N'平台+平台唯一id' , |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'sys_social', |
| | | 'COLUMN', N'auth_id' |
| | |
| | | 'COLUMN', N'source' |
| | | GO |
| | | EXEC sys.sp_addextendedproperty |
| | | 'MS_Description', N'原生openid' , |
| | | 'MS_Description', N'平台编号唯一id' , |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'sys_social', |
| | | 'COLUMN', N'open_id' |
| | |
| | | id bigint not null comment '主键', |
| | | user_id bigint not null comment '用户ID', |
| | | tenant_id varchar(20) default null comment '租户id', |
| | | auth_id varchar(255) not null comment '授权+授权openid', |
| | | auth_id varchar(255) not null comment '平台+平台唯一id', |
| | | source varchar(255) not null comment '用户来源', |
| | | open_id varchar(255) default null comment '原生open id', |
| | | open_id varchar(255) default null comment '平台编号唯一id', |
| | | user_name varchar(30) not null comment '登录账号', |
| | | nick_name varchar(30) default '' comment '用户昵称', |
| | | email varchar(255) default '' comment '用户邮箱', |