phpipam / phpipam

phpipam development repository
https://phpipam.net
2.17k stars 722 forks source link

Azure AD SAML Auth #2998

Open jboileau99 opened 4 years ago

jboileau99 commented 4 years ago

Hi,

I'm trying to setup SAML auth through Azure AD. Is there any documentation on this? I saw this but sadly that is in German.

Thanks

elhiss commented 3 years ago

Any luck with the setup?

I have followed this guide https://www.booches.nl/2020/05/phpipam-azure-and-saml-authentication/ But... In Azure the login is a success but on the phpipam side I get a blank page with "invalid_response" and nothing in Tools>Log Files...

PHP Version 7.4.3 phpipam 1.4.1

GaryAllan commented 3 years ago

Hello @elhiss There's an updated SAML plugin in the master branch (v1.50). Also includes a debugging option which displays the reason for failure.

image

elhiss commented 3 years ago

@GaryAllan Thank you for the info! will update and see if I can get it to work.

elhiss commented 3 years ago

After update to master branch the error messages was a bit easier to understand, since it wasnt just "invalid_response" I had wrong format on the certificate, reentered it and now Single Sign On via Azure works. 👌

FYI I followed this guide except downloading the Base64 cert for the thumbprint. Instead I downloaded the Federation Metadata XML and extracted the x.509 cert from there.

Skärmbild 2021-01-07 115203

Skärmbild 2021-01-07 131249

mark88d commented 1 year ago

I cannot get this working even with the above. any further updates to this issue?

BerendvW commented 1 year ago

@mark88d: as per 1.5 certificate name is the (unencoded) certificate identifier is just some unique value wich should be the same in AAD Saml username should be the complete mapping as found in aad atribute Finally, you might need to change the attribute value for display_name and email (in aad) image

mark88d commented 1 year ago

thanks @BerendvW thats great, worked

@mark88d: as per 1.5 certificate name is the (unencoded) certificate identifier is just some unique value wich should be the same in AAD Saml username should be the complete mapping as found in aad atribute Finally, you might need to change the attribute value for display_name and email (in aad) image

joakimlemb commented 1 year ago

Anyone got this working with PHPipam 1.5.2 and AzureAD? The documentation is not good enough for this to be a straight forward setup, I'm currently stuck at a 403 forbidden error during POST to https://phpipam_uri/saml2/

gnilronm commented 1 year ago

@joakimlemb, I got that working yesterday, following the guide @elhiss posted and then made sure that my claims on the Enterprise App was correct. Here's my working config. Hope that helps.

image image

joakimlemb commented 1 year ago

@gnilronm I'm not sure what was wrong but I just redid the entire config and made sure it matched yours, and it works now. Thank you.

Can't figure out JIT yet, but at least we can login with pre-provisioned users.

JIT error: Mandatory SAML JIT attribute missing : display_name (string)

Claims: image001

vivek-skumar commented 1 year ago

@gnilronm I'm not sure what was wrong but I just redid the entire config and made sure it matched yours, and it works now. Thank you.

Can't figure out JIT yet, but at least we can login with pre-provisioned users.

JIT error: Mandatory SAML JIT attribute missing : display_name (string)

Claims: image001

You need to make sure that you are adding the additional claims that JIT is expecting.

image

vadaszgergo commented 4 months ago

@vivek-skumar @elhiss @GaryAllan Based on those attributes, how does it know if a user should be admin or normal user? Can this setup automatically provision the user in phpIPAM, instead of manually creating the user first?

GaryAllan commented 4 months ago

https://github.com/phpipam/phpipam/blob/master/doc/Authentication/SAML2.md

See JIT and 'is_admin' attribute.

Anyone9060 commented 4 days ago

@gnilronm I'm not sure what was wrong but I just redid the entire config and made sure it matched yours, and it works now. Thank you.

Can't figure out JIT yet, but at least we can login with pre-provisioned users.

JIT error: Mandatory SAML JIT attribute missing : display_name (string)

Claims: image001

I tried following this with Debugging on, I simply get a white page with: "Invalid username or password"

I am not prompted for a 2FA code like I normally would though. Is that the issue?

Anyone9060 commented 4 days ago

I just got a new account working. I had to make a new user with "username" in IPAM that matches the UPN in Entra ID/AD.

Prior to this, all users were AD integrated and their "Username" in IPAM was simply "username" and not "username@domain.com"

Is there a way to convert existing AD users to SAML users? I can easily change the drop down for authentication, but I can't seem to change the usernames once they are already created.