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

Nishanthi Kumari 6 Reputation points
2021-03-04T04:35:27.717+00:00

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

https://learn.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).)

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
325 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,363 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. ajkuma 26,636 Reputation points Microsoft Employee
    2021-03-04T13:07:36.657+00:00

    @Nishanthi Kumari , 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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.