Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

Office 365 Single sign On

Copper Contributor
I want to integrate single sign on(SSO) with Office 365.I am using third party IDP GLUU. and Sync Adfs with with office365 admin pannel. When i entered email in office365 login then it is correctly redirected to gluu SignIn page then I entered username and password and got error "InvalidNameIDPolicy".
Please find  saml request- response:-
SAML Request:
<samlp:AuthnRequest ID="_099e3e23-d100-4c9b-afb1-29d7ee1e2019"
  <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">urn:federation:MicrosoftOnline</Issuer>
  <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" /></samlp:AuthnRequest>
SAML Response:
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response Destination=""
  <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"></saml2:Issuer>
    <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Requester">
      <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy" /></saml2p:StatusCode>
    <saml2p:StatusMessage>An error occurred.</saml2p:StatusMessage>
I know error is  "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy".
 So just want to know this error comes from ADFS side or IDP side?
 If this error comes from ADFS side then how to resolve this issue?
2 Replies

Hey @scl-family_1,


It looks to me like the email address is not getting mapped properly to the username or "nameID" inside of your SAML application. Essentially something else is being tested against Office 365 from the IDP.


To fix this, I would look at creating a claims rule inside of ADFS to change the nameID to the email address for your users.


This article walks through the process of creating that claim.


Once that is in place, I would expect you to resolve the error you are seeing.



Dear Adam,
I have tried your suggestion but same result and error.
I am using Gluu Idp.Please find doc for Integration Office365 in Gluu.

IDP requires three attributes IDPEmail, ImmutableID and objectguid
you can find in doc that IDP requires nameID 'ImmutableID' .This is a 'persistent' type nameID; base attribute 'objectguid'