How do I authenticate to Active Directory Rights Management Services using a bearer token from Active Directory Federation Services The Next CEO of Stack OverflowHow do I find which documents are protected by Active Directory Rights Management Services?How to add printer to Active Directory in Windows Server 2016?How to configure active directory activation from powershell/commandline?Beginner ADFS SAML setup with PingoneActive Directory migration from Windows 2003 to Windows 2016Can I add custom attributes to Active Directory schema using PowerShell only?How to stop syncing Windows Server with Azure Active DirectoryError installing Active Directory Certificate ServicesViewing Permissions in Mac OS on a Windows Server 2016 using Active DirectoryHow to disable unauthenticated binds in Active Directory(2016)

How to transpose the 1st and -1th levels of arbitrarily nested array?

Do I need to enable Dev Hub in my PROD Org?

If a black hole is created from light, can this black hole then move at speed of light?

What flight has the highest ratio of time difference to flight time?

What does "Its cash flow is deeply negative" mean?

MessageLevel in QGIS3

Are there any limitations on attacking while grappling?

How to solve a differential equation with a term to a power?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Is it professional to write unrelated content in an almost-empty email?

How to count occurrences of text in a file?

What exact does MIB represent in SNMP? How is it different from OID?

Non-deterministic sum of floats

What is the result of assigning to std::vector<T>::begin()?

"and that skill is always a class skill for you" - does "always" have any meaning in Pathfinder?

Indicator light circuit

Does it take more energy to get to Venus or to Mars?

Limits on contract work without pre-agreed price/contract (UK)

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Skipping indices in a product

Is HostGator storing my password in plaintext?

If the heap is initialized for security, then why is the stack uninitialized?

Can I equip Skullclamp on a creature I am sacrificing?

Why do professional authors make "consistency" mistakes? And how to avoid them?



How do I authenticate to Active Directory Rights Management Services using a bearer token from Active Directory Federation Services



The Next CEO of Stack OverflowHow do I find which documents are protected by Active Directory Rights Management Services?How to add printer to Active Directory in Windows Server 2016?How to configure active directory activation from powershell/commandline?Beginner ADFS SAML setup with PingoneActive Directory migration from Windows 2003 to Windows 2016Can I add custom attributes to Active Directory schema using PowerShell only?How to stop syncing Windows Server with Azure Active DirectoryError installing Active Directory Certificate ServicesViewing Permissions in Mac OS on a Windows Server 2016 using Active DirectoryHow to disable unauthenticated binds in Active Directory(2016)










1















My goal is to use the Microsoft Rights Management SDK 4.2 on a Linux system to access and manage protected documents.



I am unable to authenticate to the RMS server via a Federation Server (this is the setup that the SDK requires).



I have the following setup:



  • A domain controller, dc1.mydomain

  • A rights management server, rms1.mydomain, with Active Directory Rights Management Services, SQL Server, and the Mobile Device Extension for AD RMS

  • An authentication server, fs1.mydomain, running Federation Services

All hosts in the cluster run Windows Server 2016 and have certificates signed by a Registration Authority. The root CA and intermediate RA certificates are installed on the hosts. The token signing certificate and token decrypting certificates for the Federation Service are also signed by the RA.



Microsoft Office applications (which use an earlier SOAP protocol) are able to talk to the RMS service. The RIghts Management SDK library uses a more lightweight JSON protocol provided by the Mobile Device Extension.



I have configured an SRV DNS record for _rmsdisco._http._tcp.mydomain.



The Mobile Device Extension has been configured to use https://fs1.mydomain for authentication.



On fs1.mydomain, I have configured a "Server application accessing a web API". The server application has client ID <ID> and client secret <SECRET>. The web API has the relying party identifier api.rms.rest.com.



I am unable to get the RMS SDK client to authenticate to the RMS server with the client application credentials. This is the failing oauth2 exchange:



  1. Attempt to fetch https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain

  2. This returns a 401 response with the expected WWW-Authenticate header:
    WWW-Authenticate: Bearer realm="api.rms.rest.com", authorization="https://fs1.mydomain/adfs/oauth2/authorize"

  3. POST the following body to https://fs1.mydomain/adfs/oauth2/token:
    grant_type=client_credentials&client_id=<ID>&client_secret=<SECRET>&resource=api.rms.rest.com

  4. Obtain a signed authentication token with a decoded body looking something like this:
    "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553792250,"exp":1553795850,"apptype":"Confidential","appid":"<ID>","authmethod":"http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password","auth_time":"2019-03-28T16:57:30.037Z","ver":"1.0"

  5. Attempt to fetch the service discovery URI again, this time adding the following header:
    Authorization: Bearer <TOKEN>

  6. Server returns a 401 response instead of 200.

I'm assuming that there is an error in the server configuration but don't know what. I'm not seeing anything logged in the RMS server but I'd guess that it's failing to verify the oauth token. The token signing certificate is present in the FederationData.xml supplied by the Federation Server. I have also installed it on the RMS server under "Certificates" (the certificate authority certificates are also present).



At this point, I'm stuck, hence reaching out for help.










share|improve this question


























    1















    My goal is to use the Microsoft Rights Management SDK 4.2 on a Linux system to access and manage protected documents.



    I am unable to authenticate to the RMS server via a Federation Server (this is the setup that the SDK requires).



    I have the following setup:



    • A domain controller, dc1.mydomain

    • A rights management server, rms1.mydomain, with Active Directory Rights Management Services, SQL Server, and the Mobile Device Extension for AD RMS

    • An authentication server, fs1.mydomain, running Federation Services

    All hosts in the cluster run Windows Server 2016 and have certificates signed by a Registration Authority. The root CA and intermediate RA certificates are installed on the hosts. The token signing certificate and token decrypting certificates for the Federation Service are also signed by the RA.



    Microsoft Office applications (which use an earlier SOAP protocol) are able to talk to the RMS service. The RIghts Management SDK library uses a more lightweight JSON protocol provided by the Mobile Device Extension.



    I have configured an SRV DNS record for _rmsdisco._http._tcp.mydomain.



    The Mobile Device Extension has been configured to use https://fs1.mydomain for authentication.



    On fs1.mydomain, I have configured a "Server application accessing a web API". The server application has client ID <ID> and client secret <SECRET>. The web API has the relying party identifier api.rms.rest.com.



    I am unable to get the RMS SDK client to authenticate to the RMS server with the client application credentials. This is the failing oauth2 exchange:



    1. Attempt to fetch https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain

    2. This returns a 401 response with the expected WWW-Authenticate header:
      WWW-Authenticate: Bearer realm="api.rms.rest.com", authorization="https://fs1.mydomain/adfs/oauth2/authorize"

    3. POST the following body to https://fs1.mydomain/adfs/oauth2/token:
      grant_type=client_credentials&client_id=<ID>&client_secret=<SECRET>&resource=api.rms.rest.com

    4. Obtain a signed authentication token with a decoded body looking something like this:
      "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553792250,"exp":1553795850,"apptype":"Confidential","appid":"<ID>","authmethod":"http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password","auth_time":"2019-03-28T16:57:30.037Z","ver":"1.0"

    5. Attempt to fetch the service discovery URI again, this time adding the following header:
      Authorization: Bearer <TOKEN>

    6. Server returns a 401 response instead of 200.

    I'm assuming that there is an error in the server configuration but don't know what. I'm not seeing anything logged in the RMS server but I'd guess that it's failing to verify the oauth token. The token signing certificate is present in the FederationData.xml supplied by the Federation Server. I have also installed it on the RMS server under "Certificates" (the certificate authority certificates are also present).



    At this point, I'm stuck, hence reaching out for help.










    share|improve this question
























      1












      1








      1








      My goal is to use the Microsoft Rights Management SDK 4.2 on a Linux system to access and manage protected documents.



      I am unable to authenticate to the RMS server via a Federation Server (this is the setup that the SDK requires).



      I have the following setup:



      • A domain controller, dc1.mydomain

      • A rights management server, rms1.mydomain, with Active Directory Rights Management Services, SQL Server, and the Mobile Device Extension for AD RMS

      • An authentication server, fs1.mydomain, running Federation Services

      All hosts in the cluster run Windows Server 2016 and have certificates signed by a Registration Authority. The root CA and intermediate RA certificates are installed on the hosts. The token signing certificate and token decrypting certificates for the Federation Service are also signed by the RA.



      Microsoft Office applications (which use an earlier SOAP protocol) are able to talk to the RMS service. The RIghts Management SDK library uses a more lightweight JSON protocol provided by the Mobile Device Extension.



      I have configured an SRV DNS record for _rmsdisco._http._tcp.mydomain.



      The Mobile Device Extension has been configured to use https://fs1.mydomain for authentication.



      On fs1.mydomain, I have configured a "Server application accessing a web API". The server application has client ID <ID> and client secret <SECRET>. The web API has the relying party identifier api.rms.rest.com.



      I am unable to get the RMS SDK client to authenticate to the RMS server with the client application credentials. This is the failing oauth2 exchange:



      1. Attempt to fetch https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain

      2. This returns a 401 response with the expected WWW-Authenticate header:
        WWW-Authenticate: Bearer realm="api.rms.rest.com", authorization="https://fs1.mydomain/adfs/oauth2/authorize"

      3. POST the following body to https://fs1.mydomain/adfs/oauth2/token:
        grant_type=client_credentials&client_id=<ID>&client_secret=<SECRET>&resource=api.rms.rest.com

      4. Obtain a signed authentication token with a decoded body looking something like this:
        "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553792250,"exp":1553795850,"apptype":"Confidential","appid":"<ID>","authmethod":"http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password","auth_time":"2019-03-28T16:57:30.037Z","ver":"1.0"

      5. Attempt to fetch the service discovery URI again, this time adding the following header:
        Authorization: Bearer <TOKEN>

      6. Server returns a 401 response instead of 200.

      I'm assuming that there is an error in the server configuration but don't know what. I'm not seeing anything logged in the RMS server but I'd guess that it's failing to verify the oauth token. The token signing certificate is present in the FederationData.xml supplied by the Federation Server. I have also installed it on the RMS server under "Certificates" (the certificate authority certificates are also present).



      At this point, I'm stuck, hence reaching out for help.










      share|improve this question














      My goal is to use the Microsoft Rights Management SDK 4.2 on a Linux system to access and manage protected documents.



      I am unable to authenticate to the RMS server via a Federation Server (this is the setup that the SDK requires).



      I have the following setup:



      • A domain controller, dc1.mydomain

      • A rights management server, rms1.mydomain, with Active Directory Rights Management Services, SQL Server, and the Mobile Device Extension for AD RMS

      • An authentication server, fs1.mydomain, running Federation Services

      All hosts in the cluster run Windows Server 2016 and have certificates signed by a Registration Authority. The root CA and intermediate RA certificates are installed on the hosts. The token signing certificate and token decrypting certificates for the Federation Service are also signed by the RA.



      Microsoft Office applications (which use an earlier SOAP protocol) are able to talk to the RMS service. The RIghts Management SDK library uses a more lightweight JSON protocol provided by the Mobile Device Extension.



      I have configured an SRV DNS record for _rmsdisco._http._tcp.mydomain.



      The Mobile Device Extension has been configured to use https://fs1.mydomain for authentication.



      On fs1.mydomain, I have configured a "Server application accessing a web API". The server application has client ID <ID> and client secret <SECRET>. The web API has the relying party identifier api.rms.rest.com.



      I am unable to get the RMS SDK client to authenticate to the RMS server with the client application credentials. This is the failing oauth2 exchange:



      1. Attempt to fetch https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain

      2. This returns a 401 response with the expected WWW-Authenticate header:
        WWW-Authenticate: Bearer realm="api.rms.rest.com", authorization="https://fs1.mydomain/adfs/oauth2/authorize"

      3. POST the following body to https://fs1.mydomain/adfs/oauth2/token:
        grant_type=client_credentials&client_id=<ID>&client_secret=<SECRET>&resource=api.rms.rest.com

      4. Obtain a signed authentication token with a decoded body looking something like this:
        "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553792250,"exp":1553795850,"apptype":"Confidential","appid":"<ID>","authmethod":"http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password","auth_time":"2019-03-28T16:57:30.037Z","ver":"1.0"

      5. Attempt to fetch the service discovery URI again, this time adding the following header:
        Authorization: Bearer <TOKEN>

      6. Server returns a 401 response instead of 200.

      I'm assuming that there is an error in the server configuration but don't know what. I'm not seeing anything logged in the RMS server but I'd guess that it's failing to verify the oauth token. The token signing certificate is present in the FederationData.xml supplied by the Federation Server. I have also installed it on the RMS server under "Certificates" (the certificate authority certificates are also present).



      At this point, I'm stuck, hence reaching out for help.







      windows-server-2016 rights-management






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Chris WilliamsChris Williams

      162




      162




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Apologies for answering my own question. The problem with the bearer token appears not to be failure to verify the signature but a missing claim (email at a guess) in the payload.



          Install and configure the AD RMS Mobile Device Extension as documented here.



          There is something else you need to do that isn't documented (and which I'd guess is new for Windows Server 2016). After you add an ADFS client in Powershell, for example, the MAC OS X RMS Sharing App:



          Add-AdfsClient -Name "RMS Sharing App for macOS" -ClientId "96731E97-2204-4D74-BEA5-75DCA53566C3" -RedirectUri @("com.microsoft.rms-sharing-for-osx://authorize")


          You then need to grant the client ID permission to access the protected resource (even if you configured "Permit Access to All Users"):



          Grant-AdfsApplicationPermission -ClientRoleIdentifier "96731E97-2204-4D74-BEA5-75DCA53566C3" -ServerRoleIdentifier "api.rms.rest.com"


          Now you can authenticate using the client ID and valid credentials for a domain user. The authentication request body becomes:
          grant_type=password&client_id=96731e97-2204-4d74-bea5-75dca53566c3&username=user1@mydomain&password=mypassword&resource=api.rms.rest.com



          The returned token has a payload something like this:
          "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553874942,"exp":1553878542,"email":"user1@mydomain","upn":"user1@mydomain","apptype":"Public","appid":"96731E97-2204-4D74-BEA5-75DCA53566C3","authmethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport","auth_time":"2019-03-29T15:55:42.124Z","ver":"1.0"



          This token is accepted by the RMS server.



          One small detail: the service discovery URL is not quite correct. Even with a working bearer token, attempting to access https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain will result in a 404 response. Replace "v2" with "v1" and the response is 200. My confusion was due to the SDK effectively hardcoding "/my/v2".



          A couple more questions remain:



          1. Is it possible to get the RMS Mobile Device Extension to accept a token that doesn't contain an email claim? This is required for client ID / client secret authentication to work.

          2. What is the difference between "/my/v1" and "/my/v2" and how does one know which one to use?





          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f960493%2fhow-do-i-authenticate-to-active-directory-rights-management-services-using-a-bea%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Apologies for answering my own question. The problem with the bearer token appears not to be failure to verify the signature but a missing claim (email at a guess) in the payload.



            Install and configure the AD RMS Mobile Device Extension as documented here.



            There is something else you need to do that isn't documented (and which I'd guess is new for Windows Server 2016). After you add an ADFS client in Powershell, for example, the MAC OS X RMS Sharing App:



            Add-AdfsClient -Name "RMS Sharing App for macOS" -ClientId "96731E97-2204-4D74-BEA5-75DCA53566C3" -RedirectUri @("com.microsoft.rms-sharing-for-osx://authorize")


            You then need to grant the client ID permission to access the protected resource (even if you configured "Permit Access to All Users"):



            Grant-AdfsApplicationPermission -ClientRoleIdentifier "96731E97-2204-4D74-BEA5-75DCA53566C3" -ServerRoleIdentifier "api.rms.rest.com"


            Now you can authenticate using the client ID and valid credentials for a domain user. The authentication request body becomes:
            grant_type=password&client_id=96731e97-2204-4d74-bea5-75dca53566c3&username=user1@mydomain&password=mypassword&resource=api.rms.rest.com



            The returned token has a payload something like this:
            "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553874942,"exp":1553878542,"email":"user1@mydomain","upn":"user1@mydomain","apptype":"Public","appid":"96731E97-2204-4D74-BEA5-75DCA53566C3","authmethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport","auth_time":"2019-03-29T15:55:42.124Z","ver":"1.0"



            This token is accepted by the RMS server.



            One small detail: the service discovery URL is not quite correct. Even with a working bearer token, attempting to access https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain will result in a 404 response. Replace "v2" with "v1" and the response is 200. My confusion was due to the SDK effectively hardcoding "/my/v2".



            A couple more questions remain:



            1. Is it possible to get the RMS Mobile Device Extension to accept a token that doesn't contain an email claim? This is required for client ID / client secret authentication to work.

            2. What is the difference between "/my/v1" and "/my/v2" and how does one know which one to use?





            share|improve this answer



























              0














              Apologies for answering my own question. The problem with the bearer token appears not to be failure to verify the signature but a missing claim (email at a guess) in the payload.



              Install and configure the AD RMS Mobile Device Extension as documented here.



              There is something else you need to do that isn't documented (and which I'd guess is new for Windows Server 2016). After you add an ADFS client in Powershell, for example, the MAC OS X RMS Sharing App:



              Add-AdfsClient -Name "RMS Sharing App for macOS" -ClientId "96731E97-2204-4D74-BEA5-75DCA53566C3" -RedirectUri @("com.microsoft.rms-sharing-for-osx://authorize")


              You then need to grant the client ID permission to access the protected resource (even if you configured "Permit Access to All Users"):



              Grant-AdfsApplicationPermission -ClientRoleIdentifier "96731E97-2204-4D74-BEA5-75DCA53566C3" -ServerRoleIdentifier "api.rms.rest.com"


              Now you can authenticate using the client ID and valid credentials for a domain user. The authentication request body becomes:
              grant_type=password&client_id=96731e97-2204-4d74-bea5-75dca53566c3&username=user1@mydomain&password=mypassword&resource=api.rms.rest.com



              The returned token has a payload something like this:
              "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553874942,"exp":1553878542,"email":"user1@mydomain","upn":"user1@mydomain","apptype":"Public","appid":"96731E97-2204-4D74-BEA5-75DCA53566C3","authmethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport","auth_time":"2019-03-29T15:55:42.124Z","ver":"1.0"



              This token is accepted by the RMS server.



              One small detail: the service discovery URL is not quite correct. Even with a working bearer token, attempting to access https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain will result in a 404 response. Replace "v2" with "v1" and the response is 200. My confusion was due to the SDK effectively hardcoding "/my/v2".



              A couple more questions remain:



              1. Is it possible to get the RMS Mobile Device Extension to accept a token that doesn't contain an email claim? This is required for client ID / client secret authentication to work.

              2. What is the difference between "/my/v1" and "/my/v2" and how does one know which one to use?





              share|improve this answer

























                0












                0








                0







                Apologies for answering my own question. The problem with the bearer token appears not to be failure to verify the signature but a missing claim (email at a guess) in the payload.



                Install and configure the AD RMS Mobile Device Extension as documented here.



                There is something else you need to do that isn't documented (and which I'd guess is new for Windows Server 2016). After you add an ADFS client in Powershell, for example, the MAC OS X RMS Sharing App:



                Add-AdfsClient -Name "RMS Sharing App for macOS" -ClientId "96731E97-2204-4D74-BEA5-75DCA53566C3" -RedirectUri @("com.microsoft.rms-sharing-for-osx://authorize")


                You then need to grant the client ID permission to access the protected resource (even if you configured "Permit Access to All Users"):



                Grant-AdfsApplicationPermission -ClientRoleIdentifier "96731E97-2204-4D74-BEA5-75DCA53566C3" -ServerRoleIdentifier "api.rms.rest.com"


                Now you can authenticate using the client ID and valid credentials for a domain user. The authentication request body becomes:
                grant_type=password&client_id=96731e97-2204-4d74-bea5-75dca53566c3&username=user1@mydomain&password=mypassword&resource=api.rms.rest.com



                The returned token has a payload something like this:
                "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553874942,"exp":1553878542,"email":"user1@mydomain","upn":"user1@mydomain","apptype":"Public","appid":"96731E97-2204-4D74-BEA5-75DCA53566C3","authmethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport","auth_time":"2019-03-29T15:55:42.124Z","ver":"1.0"



                This token is accepted by the RMS server.



                One small detail: the service discovery URL is not quite correct. Even with a working bearer token, attempting to access https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain will result in a 404 response. Replace "v2" with "v1" and the response is 200. My confusion was due to the SDK effectively hardcoding "/my/v2".



                A couple more questions remain:



                1. Is it possible to get the RMS Mobile Device Extension to accept a token that doesn't contain an email claim? This is required for client ID / client secret authentication to work.

                2. What is the difference between "/my/v1" and "/my/v2" and how does one know which one to use?





                share|improve this answer













                Apologies for answering my own question. The problem with the bearer token appears not to be failure to verify the signature but a missing claim (email at a guess) in the payload.



                Install and configure the AD RMS Mobile Device Extension as documented here.



                There is something else you need to do that isn't documented (and which I'd guess is new for Windows Server 2016). After you add an ADFS client in Powershell, for example, the MAC OS X RMS Sharing App:



                Add-AdfsClient -Name "RMS Sharing App for macOS" -ClientId "96731E97-2204-4D74-BEA5-75DCA53566C3" -RedirectUri @("com.microsoft.rms-sharing-for-osx://authorize")


                You then need to grant the client ID permission to access the protected resource (even if you configured "Permit Access to All Users"):



                Grant-AdfsApplicationPermission -ClientRoleIdentifier "96731E97-2204-4D74-BEA5-75DCA53566C3" -ServerRoleIdentifier "api.rms.rest.com"


                Now you can authenticate using the client ID and valid credentials for a domain user. The authentication request body becomes:
                grant_type=password&client_id=96731e97-2204-4d74-bea5-75dca53566c3&username=user1@mydomain&password=mypassword&resource=api.rms.rest.com



                The returned token has a payload something like this:
                "aud":"microsoft:identityserver:api.rms.rest.com","iss":"http://fs1.mydomain/adfs/services/trust","iat":1553874942,"exp":1553878542,"email":"user1@mydomain","upn":"user1@mydomain","apptype":"Public","appid":"96731E97-2204-4D74-BEA5-75DCA53566C3","authmethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport","auth_time":"2019-03-29T15:55:42.124Z","ver":"1.0"



                This token is accepted by the RMS server.



                One small detail: the service discovery URL is not quite correct. Even with a working bearer token, attempting to access https://rms1.mydomain:443/my/v2/servicediscovery?email=user1@mydomain will result in a 404 response. Replace "v2" with "v1" and the response is 200. My confusion was due to the SDK effectively hardcoding "/my/v2".



                A couple more questions remain:



                1. Is it possible to get the RMS Mobile Device Extension to accept a token that doesn't contain an email claim? This is required for client ID / client secret authentication to work.

                2. What is the difference between "/my/v1" and "/my/v2" and how does one know which one to use?






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 7 hours ago









                Chris WilliamsChris Williams

                162




                162



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f960493%2fhow-do-i-authenticate-to-active-directory-rights-management-services-using-a-bea%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company