Hi,
I don't know if this is the right subforum to post this question but I think this is the closest one related to our problem. We are trying to simulate an actual printer registration to Microsoft Universal Print . Here are the steps we did:
1) Send a POST webservice request to MCP Registration Service:"https://register.print.microsoft.com/api/v0.1/register"
The request payload is seen below:
{
"name": "Test Printer 11",
"manufacturer": "PrinterManufacturer",
"model": "PrinterModel",
"device_type": "printer",
"device_id": "c4303900-c7c2-4419-8eec-5a7d9a304af9",
"certificate_request": {
"type": "pkcs10",
"data": "MIIEBTCCAu2gAwIBAgIJAL0+JAB9oDCMMA0GCSqGSIb3DQEBCwUAMIGYMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHUmVkbW9uZDEXMBUGA1UECgwOTWljcm9zb2Z0IENvcnAxCzAJBgNVBAsMAklUMRIwEAYDVQQDDAlNaWNyb3NvZnQxKDAmBgkqhkiG9w0BCQEWGWpvaG5odWJlcnQubWFAbGV4bWFyay5jb20wHhcNMTkwNzI1MDkyMDU0WhcNMTkwODI0MDkyMDU0WjCBmDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1JlZG1vbmQxFzAVBgNVBAoMDk1pY3Jvc29mdCBDb3JwMQswCQYDVQQLDAJJVDESMBAGA1UEAwwJTWljcm9zb2Z0MSgwJgYJKoZIhvcNAQkBFhlqb2huaHViZXJ0Lm1hQGxleG1hcmsuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwo8lLBniQxoJBz6cOO1R3WyMX5VDsnSH1yH7fREIJHZBfokawjOlCHbfwaL7rmGFR6rMetGA7Myl5+I7uEwzUISa17ShazAmiw+QAT0nqRYGqNk3NM8ZPy8whfVzC6OxQs5IifrkI8hTvTpGdZrpwOWdg3ISUtel0GlJKzvU1+8Jj5jCoGqU3VITnHMdq1l7cTc2ZhmTPB8H8Rt7e+VkEVOiVuuz4ecRhjBQBS1KQxrBfHQpkb+XwSV5wc8/bS7pu5ziypkZBtcDLMxgdpyLBtm0OXaRFc5Q1TPfnjKOjtq7CDca3qx8RndtV2AtqOpPpuSb52rYUcXjYQDXCu5FgQIDAQABo1AwTjAdBgNVHQ4EFgQUHFyAjucfm5WWpuhkTSMhW+mJUPAwHwYDVR0jBBgwFoAUHFyAjucfm5WWpuhkTSMhW+mJUPAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAQqGHniEmsjl/HFx173qgwltCwPrEiPoPYJnnxW3+5rjZrmaFaQ/XQ30VtZ39z6jMA5QLWpud1/8GFAOwGdVpOiRXrcMIQ7CWlMc7BUw2a8xwOxpzD/720FYKCRPGAHh3o1/J1H05xOzzrnkg2qChdlu9q9p0IwmKGfZJ/OB9FX5fhCHMC1LCmXnowQB8YkEgrZVX59cnoSBjJb17Tqpr7VlMIh81Lq+g7FS1sRFYF0oQLukQmkc37GQFDgW+HBscoTpgjiNwUsz9CMglB1Jkq8zzY9NKcvtKDYK++dzoareo66hnJIEhD6vcMpuHFSfJhX605xI6IvfidGPGEG4D6Q==",
"transport_key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwo8lLBniQxoJBz6cOO1R3WyMX5VDsnSH1yH7fREIJHZBfokawjOlCHbfwaL7rmGFR6rMetGA7Myl5+I7uEwzUISa17ShazAmiw+QAT0nqRYGqNk3NM8ZPy8whfVzC6OxQs5IifrkI8hTvTpGdZrpwOWdg3ISUtel0GlJKzvU1+8Jj5jCoGqU3VITnHMdq1l7cTc2ZhmTPB8H8Rt7e+VkEVOiVuuz4ecRhjBQBS1KQxrBfHQpkb+XwSV5wc8/bS7pu5ziypkZBtcDLMxgdpyLBtm0OXaRFc5Q1TPfnjKOjtq7CDca3qx8RndtV2AtqOpPpuSb52rYUcXjYQDXCu5FgQIDAQAB"
}
}
2) The MCP Registration Service response is seen below:
202 Accepted
{
"registration_id": "019d936c-c087-478c-9458-5899aa2c479e",
"user_code": "B9928AH5X",
"messages": [
{
"message": "To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code B9928AH5X to authenticate.",
"lang": "en-us"
}
],
"verification_url": "https://microsoft.com/devicelogin",
"interval": 5
}
3) Before going to the verification url, we check the registration status by doing a GET webservice request to MCP Registration service using the registration id provided: "https://register.print.microsoft.com/api/v0.1/register?registration_id=019d936c-c087-478c-9458-5899aa2c479e"
4) The MCP Registration Service response is seen below which indicates that Registration is in progress:
202 Accepted
{
"interval": 5
}
5) Authenticate and verify the registration by going to "https://microsoft.com/devicelogin" and input "B9928AH5X" as the code.
6) Microsoft asks to pick an account to sign in. We use our company email which is registered in Azure Active Directory with a role of "user".
7) A successful confimation is displayed in the browser: "You have signed in to the Microsoft Print Enabled Printer application on your device. You may now close this window."
8) Check the registration status again(We should now receive a 200 OK for "Registered"): "https://register.print.microsoft.com/api/v0.1/register?registration_id=019d936c-c087-478c-9458-5899aa2c479e"
9) An error is now returned by the MCP Registration Service:
403 Forbidden
{
"error": "invalid_request",
"error_description": "User not authorized to access Microsoft Universal Print",
"registration_id": "019d936c-c087-478c-9458-5899aa2c479e",
"http_status_code": 403
}
We are not sure what is causing this error and maybe this forum can point us in the right direction. On our end, we tried to play around with how we generated our certificate signing request. We followed the requirements stated in the UPAPI.pdf specs on
how to generate the CSR(The certificate request MUST use an RSA public key algorithm with a 2048-bit key, a SHA256WithRSAEncryption signature algorithm, and a SHA256 hash algorithm).
We also tried using a different(newly created) microsoft account during the authentication step but we got an error stating that the said account does not exist in tenant Azure Active Directory.
Should we try using a microsoft account with an "admin" role in Azure Active Directory? The account we have and currently using is only defined as "user" and searching for "Universal Print" in "https://portal.azure.com"
comes out empty.