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

Update webserver.js - allow saml relaystate in POST request #6685

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nmmclwhitehead
Copy link
Contributor

added relaystate and regex check to prevent redirecting to a page outside of the configured server. also checks for the allowed query params

ref #6272

added check for relaystate saml and regex check
@si458
Copy link
Collaborator

si458 commented Jan 11, 2025

the is lots more RegExp to check, below is the ones ive found you missed
hint look for urlargs in the handlebars files

lang
sitestyle
key
locale
user
pass
gotomesh
gotouser
gotougrp
debug
filter
webrtc
hide

@si458
Copy link
Collaborator

si458 commented Jan 13, 2025

What provider did you use to test relaystate?
As I just couldn't get it working my side
Also how did you set it up etc?

@nmmclwhitehead
Copy link
Contributor Author

adfs

ylian's guide is still pretty good https://ylianst.github.io/MeshCentral/other/adfs_sso_guide/

also relaystate has to be enable on the adfs server Set-AdfsProperties -EnableRelayStateForIdpInitiatedSignOn $true

@si458
Copy link
Collaborator

si458 commented Jan 13, 2025

@nmmclwhitehead ah right ok!
Never realised windows active directory supported sso by url!
Learn something new every day!

correct formatting on regex string - now evaluates correctly
@nmmclwhitehead
Copy link
Contributor Author

@si458 tested the following and can confirm they work (note the viewmode also has to be set to the correct id)
sitestyle
gotomesh
gotouser
gotougrp
gotodevicename
gotodeviceip
viewmode(on its own)

@si458
Copy link
Collaborator

si458 commented Jan 15, 2025

@nmmclwhitehead thats great!
now we need to set your url as RelayState which then gets passed to your provider!
sorry ive been snowed under so i can have alook at that this weekend when i have some free time!

@si458
Copy link
Collaborator

si458 commented Jan 15, 2025

this might also fix this old issue too #4882

@nmmclwhitehead
Copy link
Contributor Author

@si458 no problem , whenever you get chance.

i guess it could be if you use the /auth-saml url then check for additional query params. then build and set the relaystate

not sure if you can use relaystate with OAuth, openid etc

@nmmclwhitehead
Copy link
Contributor Author

@si458 okay yeah looks like this can be done with req.query

ill have a look ... see what you think after i make the commit :)

set relaystate on get request
check for ipv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants