mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
authentification oauth2
This commit is contained in:
parent
c115046a7c
commit
1c8a00943c
3 changed files with 31 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ kenton:accounts-sandstorm
|
||||||
service-configuration@1.0.11
|
service-configuration@1.0.11
|
||||||
useraccounts:unstyled
|
useraccounts:unstyled
|
||||||
useraccounts:flow-routing
|
useraccounts:flow-routing
|
||||||
|
salleman:accounts-oidc
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
check@1.2.5
|
check@1.2.5
|
||||||
|
|
|
||||||
|
|
@ -459,6 +459,17 @@ if (Meteor.isServer) {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (user.services.oidc) {
|
||||||
|
user.username = user.services.oidc.username;
|
||||||
|
user.emails = [{
|
||||||
|
address: user.services.oidc.email.toLowerCase(),
|
||||||
|
verified: false,
|
||||||
|
}];
|
||||||
|
const initials = user.services.oidc.fullname.match(/\b[a-zA-Z]/g).join('').toUpperCase();
|
||||||
|
user.profile = { initials: initials, fullname: user.services.oidc.fullname };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (options.from === 'admin') {
|
if (options.from === 'admin') {
|
||||||
user.createdThroughApi = true;
|
user.createdThroughApi = true;
|
||||||
return user;
|
return user;
|
||||||
|
|
|
||||||
|
|
@ -54,5 +54,24 @@ Meteor.startup(() => {
|
||||||
Authentication.checkAdminOrCondition(userId, normalAccess);
|
Authentication.checkAdminOrCondition(userId, normalAccess);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (Meteor.isServer) {
|
||||||
|
ServiceConfiguration.configurations.upsert(
|
||||||
|
{ service: 'oidc' },
|
||||||
|
{
|
||||||
|
$set: {
|
||||||
|
loginStyle: 'redirect',
|
||||||
|
clientId: 'CLIENT_ID',
|
||||||
|
secret: 'SECRET',
|
||||||
|
serverUrl: 'https://my-server',
|
||||||
|
authorizationEndpoint: '/oauth/authorize',
|
||||||
|
userinfoEndpoint: '/oauth/userinfo',
|
||||||
|
tokenEndpoint: '/oauth/token',
|
||||||
|
idTokenWhitelistFields: [],
|
||||||
|
requestPermissions: ['openid']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue