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

Migrate to openid client #5856

Merged
merged 62 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e21fcaa
Create forksync.yml
mstrhakr Sep 7, 2022
339d816
update oidc to use openid-client
mstrhakr Sep 8, 2022
eccd3b2
update oidc module requirements
mstrhakr Sep 8, 2022
da838b4
working oidc+
mstrhakr Sep 10, 2022
37253b5
update openid-client install checks
mstrhakr Sep 11, 2022
0250aa4
created overarching schema for OIDC
mstrhakr Sep 11, 2022
e3373bb
bug fixs for azure login
mstrhakr Sep 11, 2022
16b7138
update schema
mstrhakr Sep 14, 2022
b1fb0de
update 'oidc' to strategy variable
mstrhakr Sep 14, 2022
fd9ef9b
working azure+ groups
mstrhakr Sep 14, 2022
ed94971
clean up old config import + working google oidc
mstrhakr Sep 15, 2022
d5f75db
added convertStrArray
mstrhakr Sep 19, 2022
bda0b00
de-expanded scope
mstrhakr Sep 19, 2022
832f0e8
swap back to using authlog debugger
mstrhakr Sep 19, 2022
a6fa0f9
Update meshcentral-config-schema.json
mstrhakr Sep 20, 2022
71b46c0
working google oidc + groups
mstrhakr Sep 20, 2022
a5166ef
working azure+groups (again)
mstrhakr Sep 20, 2022
7007d45
init oidc docs
mstrhakr Sep 20, 2022
efc30a6
add oidc
mstrhakr Sep 21, 2022
04ab471
more work on docs
mstrhakr Sep 21, 2022
f4a23fd
add scope and claim options
mstrhakr Sep 21, 2022
8bcd290
further cleanup debug
mstrhakr Sep 21, 2022
e87d82c
more debug cleanup
mstrhakr Sep 21, 2022
83f4f1b
continue documentation push
mstrhakr Sep 21, 2022
a97fe51
more work on docs
mstrhakr Sep 22, 2022
4a3e353
done with docs
mstrhakr Sep 22, 2022
4b85063
minor fix + presets get correct icon
mstrhakr Sep 22, 2022
b9cb2be
fix google oidc not visible at login
mstrhakr Sep 23, 2022
bc49b5b
fix bug with emailVerified property
mstrhakr Sep 23, 2022
234d7a5
fix logout bug + debug cleanup
mstrhakr Sep 23, 2022
28348d2
fix strategy logout bug +cleanup
mstrhakr Sep 23, 2022
4a3f0ca
fixed preset login icon
mstrhakr Sep 23, 2022
a1d3c6b
fix alert + fix schema
mstrhakr Sep 23, 2022
6919fb8
terminate lines
mstrhakr Sep 23, 2022
d2ed19a
Dutch language update 1.0.85
petervanv Sep 20, 2022
3d49f20
Fixed guest web relay session revocation (#4667)
Ylianst Oct 25, 2022
83243ad
Updated French translation.
Ylianst Dec 14, 2022
9059708
Add hook to allow adding custom api endpoints to Express routing
MartinMa Jan 27, 2023
3b0c068
Updated German translation.
Ylianst Aug 6, 2023
adf4224
Update meshcentral-config-schema.json (change formatting)
faustogut Jul 27, 2023
0c5c86a
Fixed schema.
Ylianst Aug 6, 2023
b14deb2
fix meshcentral-config-schema.json
si458 Aug 12, 2023
dc3c8bf
add language selector to login (#5648)
si458 Jan 4, 2024
25bd220
remove additionalProperties: false in schema to allow comments #5697
si458 Jan 15, 2024
f80ea16
fix notes in docs
si458 Jan 18, 2024
8e11059
Fix web relay session handling and redirection due to bad merge
mstrhakr Feb 23, 2024
48ad8cb
Added option to check HTTP origin.
Ylianst Feb 17, 2024
a561228
add links and fix typo
mstrhakr Feb 24, 2024
683c32a
move groups after strategy
mstrhakr Feb 25, 2024
e955137
Update version split in docs
mstrhakr Feb 26, 2024
e178642
Fix preset issuer URL in OIDC strategy
mstrhakr Feb 29, 2024
1af71b2
Update clientid and clientsecret to client_id and client_secret
mstrhakr Feb 29, 2024
23b78b8
Update meshcentral-config-schema.json and fix bad rebase
mstrhakr Mar 2, 2024
a818bb5
Update meshcentral-config-schema.json
mstrhakr Mar 2, 2024
3afae61
fix bad rebase
mstrhakr Mar 2, 2024
74b7f9c
fix bad rebase
mstrhakr Mar 2, 2024
577df83
Add 'connect-flash' to passport dependencies
mstrhakr Mar 3, 2024
a49f5ab
Remove unnecessary passport dependencies - fix bad rebase
mstrhakr Mar 3, 2024
e532bdb
Fix auth strategy bug and remove console.log statement
mstrhakr Mar 3, 2024
64f813d
Set groupType to the preset name if it exists, otherwise use the stra…
mstrhakr Mar 3, 2024
488bbe2
remove finally block from
mstrhakr Mar 3, 2024
8df03d3
Refactor authentication logging in handleStrategyLogin to include str…
mstrhakr Mar 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,17 @@ module.exports.moveOldFiles = function (filelist) {
for (var i in filelist) { if (fs.existsSync(filelist[i] + oldFileExt) == true) { extOk = false; } }
} while (extOk == false);
for (var i in filelist) { try { fs.renameSync(filelist[i], filelist[i] + oldFileExt); } catch (ex) { } }
}

// Convert strArray to Array, returns array if strArray or null if any other type
module.exports.convertStrArray = function (object, split) {
if (split && typeof object === 'string') {
return object.split(split)
} else if (typeof object === 'string') {
return Array(object);
} else if (Array.isArray(object)) {
return object
} else {
return []
}
}
34 changes: 33 additions & 1 deletion docs/docs/meshcentral/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,39 @@ Enabling SAML will require MeshCentral to install extra modules from NPM, so dep

!!!note
MeshCentral only supports "POST". [For example Authentik's](https://github.com/Ylianst/MeshCentral/issues/4725) default setting is to use "Redirect" as a "Service Provider Binding".


### Generic OpenID Connect Setup

Generally, if you are using an IdP that supports OpenID Connect (OIDC), you can use a very basic configuration to get started, and if needed, add more specific or advanced configurations later. Here is what your config file will look like with a basic, generic, configuration.

``` json
{
"settings": {
"cert": "mesh.your.domain",
"port": 443,
"sqlite3": true
},
"domains": {
"": {
"title": "Mesh",
"title2": ".Your.Domain",
"authStrategies": {
"oidc": {
"issuer": "https://sso.your.domain",
"clientid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"clientsecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"newAccounts": true
}
}
}
}
}
```

As you can see, this is roughly the same as all the other OAuth2 based authentication strategies. These are the basics you need to get started using OpenID Connect because it's still authenticating with OAuth2. If you plan to take advantage of some of the more advanced features provided by this strategy you should consider reading the [additional strategy documentation](./openidConnectStrategy.md).

> NOTE: MeshCentral will use `https://mesh.your.domain/auth-oidc-callback` as the default redirect uri.

## Improvements to MeshCentral

In 2007, the first version of MeshCentral was built. We will refer to it as “MeshCentral1”. When MeshCentral1 was designed, HTML5 did not exist and web sockets where not implemented in any of the major browsers. Many design decisions were made at the time that are no longer optimal today. With the advent of the latest MeshCentral, MeshCentral1 is no longer supported and MeshCentral v2 has been significantly redesigned and mostly re-written based of previous version. Here is a list of improvements made in MeshCentral when compared with MeshCentral1:
Expand Down
654 changes: 654 additions & 0 deletions docs/docs/meshcentral/openidConnectStrategy.md

Large diffs are not rendered by default.

Loading
Loading