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

Add InvalidError for NativeAuth #2297

Merged
merged 9 commits into from
Jan 28, 2024
Merged

Add InvalidError for NativeAuth #2297

merged 9 commits into from
Jan 28, 2024

Conversation

SaurabhMSFT
Copy link
Contributor

@SaurabhMSFT SaurabhMSFT commented Jan 25, 2024

@SaurabhMSFT SaurabhMSFT changed the title Return invalid username error instead of unknown error Add InvalidError for NativeAuth Jan 25, 2024
@SaurabhMSFT SaurabhMSFT added the No-Changelog This Pull-Request has no associated changelog entry. label Jan 25, 2024
@SaurabhMSFT SaurabhMSFT added the Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR label Jan 25, 2024
@SaurabhMSFT SaurabhMSFT marked this pull request as ready for review January 25, 2024 12:52
@SaurabhMSFT SaurabhMSFT requested a review from a team as a code owner January 25, 2024 12:52
@@ -72,4 +72,15 @@ interface INativeAuthCommandResult {
open val correlationId: String = DiagnosticContext.INSTANCE.threadCorrelationId,
open val errorCodes: List<Int>? = null
)

data class InvalidUsername(
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this class returned? I'm not seeing updates to the Controller or anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@@ -72,4 +72,15 @@ interface INativeAuthCommandResult {
open val correlationId: String = DiagnosticContext.INSTANCE.threadCorrelationId,
open val errorCodes: List<Int>? = null
)

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're checking for blank usernames in the SDK interface, then we can remove the ArgUtils.validateNonNullArg(username, "username") from the respective request classes right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@SaurabhMSFT SaurabhMSFT requested a review from a team as a code owner January 26, 2024 14:21
@SaurabhMSFT SaurabhMSFT merged commit 14fc4ac into dev Jan 28, 2024
14 checks passed
@SaurabhMSFT SaurabhMSFT deleted the saugautam/2768595 branch January 28, 2024 23:42
SaurabhMSFT added a commit to AzureAD/microsoft-authentication-library-for-android that referenced this pull request Jan 29, 2024
If the username is empty or malformed then a InvalidUsername error is returned instead of UnknownError

Corresponding PR in common repo:
AzureAD/microsoft-authentication-library-common-for-android#2297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No-Changelog This Pull-Request has no associated changelog entry. Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants