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

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020