|
|
|
@ -32,9 +32,9 @@ import { standardRequest } from "../config/request";
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
|
const GoogleStrategy = require("passport-google-oauth20").Strategy;
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
|
const GitHubStrategy = require("passport-github").Strategy;
|
|
|
|
|
const GitHubStrategy = require("passport-oauth2").Strategy;
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
|
const GitLabStrategy = require("passport-gitlab2").Strategy;
|
|
|
|
|
const GitLabStrategy = require("passport-oauth2").Strategy;
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
|
const { MultiSamlStrategy } = require("@node-saml/passport-saml");
|
|
|
|
|
|
|
|
|
@ -158,10 +158,11 @@ const initializePassport = async () => {
|
|
|
|
|
|
|
|
|
|
if (clientIdGitHubLogin && clientSecretGitHubLogin) {
|
|
|
|
|
passport.use(new GitHubStrategy({
|
|
|
|
|
passReqToCallback: true,
|
|
|
|
|
clientID: clientIdGitHubLogin,
|
|
|
|
|
clientSecret: clientSecretGitHubLogin,
|
|
|
|
|
callbackURL: "/api/v1/sso/github",
|
|
|
|
|
authorizationURL: 'https://git.cereg.com/login/oauth/authorize',
|
|
|
|
|
tokenURL: 'https://git.cereg.com/login/oauth/access_token',
|
|
|
|
|
clientID: clientIdGitLabLogin,
|
|
|
|
|
clientSecret: clientSecretGitLabLogin,
|
|
|
|
|
callbackURL: "/api/v1/sso/gitlab",
|
|
|
|
|
scope: ["user:email"]
|
|
|
|
|
},
|
|
|
|
|
async (req : express.Request, accessToken : any, refreshToken : any, profile : any, done : any) => {
|
|
|
|
@ -231,6 +232,8 @@ const initializePassport = async () => {
|
|
|
|
|
if (urlGitLab && clientIdGitLabLogin && clientSecretGitLabLogin) {
|
|
|
|
|
passport.use(new GitLabStrategy({
|
|
|
|
|
passReqToCallback: true,
|
|
|
|
|
authorizationURL: 'https://git.cereg.com/login/oauth/authorize',
|
|
|
|
|
tokenURL: 'https://git.cereg.com/login/oauth/access_token',
|
|
|
|
|
clientID: clientIdGitLabLogin,
|
|
|
|
|
clientSecret: clientSecretGitLabLogin,
|
|
|
|
|
callbackURL: "/api/v1/sso/gitlab",
|
|
|
|
|