Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Sso Backend support #3366

Open
wants to merge 17 commits into
base: dev
Choose a base branch
from
Open

[Feature] Sso Backend support #3366

wants to merge 17 commits into from

Conversation

yangzehan
Copy link
Contributor

Integrate github's oauth authentication.Other SSO authentication can be expanded in the future.
image
Users need to enable the sso function in the configuration
image
and configure the correct authentication parameters
Access the /sso/token port to log in.
image

@Zzm0809 Zzm0809 changed the title Sso Backend support [Feature] Sso Backend support Apr 9, 2024
url: jdbc:mysql://${MYSQL_ADDR:127.0.0.1:3306}/${MYSQL_DATABASE:dinky}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: ${MYSQL_USERNAME:dinky}
password: ${MYSQL_PASSWORD:dinky}
url: jdbc:mysql://${MYSQL_ADDR:127.0.0.1:3306}/${MYSQL_DATABASE:dinky2}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollback this file

@Zzm0809 Zzm0809 added this to the 1.1.0 milestone Apr 10, 2024
@Zzm0809 Zzm0809 added the New Feature New feature label Apr 10, 2024
@RequestMapping("/api/sso")
@ConfigurationProperties(prefix = "pac4j")
public class SsoCpntroller {
@Value("${sso.baseUrl:localhost:8000}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议添加一个配置类来统一管理这些配置

@@ -16,7 +16,7 @@ spring:
# If you use pgsql database, please configure pgsql database connection information in application-pgsql.yml
# If you use the h2 database, please configure the h2 database connection information in application-h2.yml,
# note: the h2 database is only for experience use, and the related data that has been created cannot be migrated, please use it with caution
active: ${DB_ACTIVE:h2} #[h2,mysql,pgsql]
active: ${DB_ACTIVE:mysql} #[h2,mysql,pgsql]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollback this line

@@ -21,7 +21,8 @@

public enum UserType {
LDAP(1, "LDAP"),
LOCAL(0, "LOCAL");
LOCAL(0, "LOCAL"),
SSO(2, "LOCAL");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sso 的 value 是 local?

@@ -52,6 +54,33 @@ const Login: React.FC = () => {
height: '100%'
};
});
useEffect(() => {
console.log(location.hash)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

@RequestMapping("/api/sso")
public class SsoCpntroller {
@Value("${sso.redirect}")
private String redirect;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与下边几个配置抽取一个配置类 然后注入

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature
Projects
Status: Doing
Development

Successfully merging this pull request may close these issues.

None yet

2 participants