question

NishanthiKumari-8287 avatar image
0 Votes"
NishanthiKumari-8287 asked ·

One or more errors occurred. (Response status code does not indicate success: 401 (Unauthorized).) in azure device register

I have follow this example to send push notifications to Xamarin forms.

https://docs.microsoft.com/en-us/azure/developer/mobile-apps/notification-hubs-backend-service-xamarin-forms

When register device to azure from device i am getting this error

One or more errors occurred. (Response status code does not indicate success: 401 (Unauthorized).)


dotnet-xamarinformsazure-notification-hubs
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ·

@NishanthiKumari-8287, Could you please confirm on which region have you hosted your app/service? does this happen when you're testing it locally as well?

Kindly review the credentials for correctness.


Validate that you're setting the apikey request header and this value matches the one you had configured for the backend service.

If you receive this error when testing locally, ensure the key value you defined in the client config, matches the Authentication:ApiKey user-setting value used by the API.

If you're testing with an API App, ensure the key value in the client config file matches the Authentication:ApiKey application setting you're using in the API App.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.