Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Communication] - Authentication - PhoneNumberAdministrationClient auth using token credential #13271

Merged
merged 25 commits into from
Jan 22, 2021

Conversation

JoshuaLai
Copy link
Member

No description provided.

@JoshuaLai
Copy link
Member Author

/azp run js - communication - tests

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Azure Azure deleted a comment from azure-pipelines bot Jan 21, 2021
@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
```

#### Creating an instance of PhoneNumberAdministrationClient with TokenCredential

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is saying TokenCredential enough for users to know that they can authenticate using managed identity (Azure Active Directory Authentication)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is fair I think we can make this change to be more consistent with the other platforms. I will update the change log as well.

recorder
};
}

try {
credential = new DefaultAzureCredential();
credential = new ClientSecretCredential(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did DefaultAzureCredential not work as in Java and Python?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting one. Under the hood there isn't a huge difference between the two. But when debugging we found that using DefaultAzureCredential threw this complicated error that made it very hard to debug the issue, but when using ClientSecretCredential it gave a more specific error (telling us there was an issue with the env vars). That was why I wanted to stick to ClientSecretCredential. Thoughts @DominikMe ? I know you wanted to originally use DefaultAzureCredential as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshuaLai Looking at your git history, you've switched to ClientSecretCredential in one commit which failed, then you added another commit that adds the missing env vars which passed. I don't think the switch to ClientSecretCredential was necessary, just the missing env vars were the culprit.

With the env vars present, DefaultAzureCredential should use EnvironmentCreedential which then uses ClientSecretCredential. So could you switch back to DefaultAzureCredential and try again? :-)

@JoshuaLai
Copy link
Member Author

/azp run js - communication-administration - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshuaLai JoshuaLai merged commit 7f89cb1 into Azure:master Jan 22, 2021
@JoshuaLai JoshuaLai deleted the feature/phoneauthpolicy branch January 22, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants