-
Notifications
You must be signed in to change notification settings - Fork 231
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 None and OAuth synonyms #2610
base: main
Are you sure you want to change the base?
Conversation
@@ -59,6 +59,10 @@ public void Configure(string? name, JwtBearerOptions options) | |||
RoleClaimType = AuthenticationOptions.ROLE_CLAIM_TYPE | |||
}; | |||
|
|||
// TODO: The PR says "This (OAuth) also opens up a future direction should we need to handle special cases with EntraId." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a discussion :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how that would be a behavioral change? From my understanding (and correct me if I am wrong), EntraId will be the one that would need the behavioral changes in the future as it is EntraId the one that will handle the special cases.
This PR still needs some discussions with the team as the issue's requirements don't really match DAB's behaviour. These changes can be made, but I doubt that such big changes are intended in this simple PR. Therefore, let's discuss what changes are still required:
|
@microsoft-github-policy-service agree |
/azp run |
ImportantBefore this is merged, we need to make a change. This is my fault. In addition to This would be an additional synonym and what we recommend to users deploying to ACA and ACI. |
Hi @JerryNixon ! I've added some more code to the PR that implements your request. However, the PR is now littered with a few TODOs as your case seems to complicate some matters. I'd like to ask if someone from the team can take a look at it. If my team agree that my TODO's require this PR to become more complex, it might be worth putting the generic Another reason to consider moving the |
@@ -68,6 +68,8 @@ protected override Task<AuthenticateResult> HandleAuthenticateAsync() | |||
{ | |||
EasyAuthType.StaticWebApps => StaticWebAppsAuthentication.Parse(Context, Logger), | |||
EasyAuthType.AppService => AppServiceAuthentication.Parse(Context, Logger), | |||
EasyAuthType.EasyAuth => StaticWebAppsAuthentication.Parse(Context, Logger), // TODO: Is this correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dab team: Please advise
@@ -27,7 +27,10 @@ public static AuthenticationBuilder AddEasyAuthAuthentication( | |||
throw new ArgumentNullException(nameof(builder)); | |||
} | |||
|
|||
if (easyAuthAuthenticationProvider is EasyAuthType.StaticWebApps) | |||
// TODO: Same question as in ClientRoleHeaderAuthenticationMiddleware. Jerry Nixon says that EASY_AUTH is also a synonym for STATIC_WEB_APPS/APP_SERVICE/NONE in DAB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dab team: Please advise
@@ -179,8 +179,13 @@ public static bool IsSystemRole(string roleName) | |||
/// <returns>Authentication Scheme</returns> | |||
private static string ResolveConfiguredAuthNScheme(string? configuredProviderName) | |||
{ | |||
// TODO: Jerry Nixon says that EASY_AUTH is also a synonym for STATIC_WEB_APPS/APP_SERVICE/NONE in DAB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dab team: Please advise
/azp run |
Got it, lets discuss in line with respect to each TODO
Yes please add the properties in the schema in this PR or in an immediate subsequent one even though they are not being validated.
Lets create a separate PR to validate the config using the schema. It was simply a miss by previous contributors.
Could you please provide edits to the docs here:
Will look into the PR this week. Thanks for your patience. |
@@ -175,6 +175,84 @@ public static Process ExecuteDabCommand(string command, string flags) | |||
} | |||
}"; | |||
|
|||
/// <summary> | |||
/// Only Runtime section containing both rest and graphql enabled, with None authentication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the comment so that we know it changes the authentication to none?
}"; | ||
|
||
/// <summary> | ||
/// Only Runtime section containing both rest and graphql enabled. The authentication provider can be replaced with <>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the comment above
}"; | ||
|
||
/// <summary> | ||
/// Only Runtime section containing both rest and graphql enabled. The authentication provider can be replaced with <>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the comment above.
} | ||
|
||
/// <summary> | ||
/// This Test is used to verify that the None authentication scheme is valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// This Test is used to verify that the None authentication scheme is valid | |
/// This test verifies that the 'None' authentication schema is valid |
} | ||
|
||
/// <summary> | ||
/// This Test is used to verify that the JWT properties must be added when the authentication scheme is Not easyAuth and not Simulator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// This Test is used to verify that the JWT properties must be added when the authentication scheme is Not easyAuth and not Simulator. | |
/// This test verifies that the JWT properties must be added when the authentication schema is not easyAuth and not Simulator. |
/// <summary> | ||
/// This Test is used to verify that the JWT properties must be added when the authentication scheme is Not easyAuth and not Simulator. | ||
/// </summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding this test is checking for situations in which there is missing information. Could you add a bit more detail to the description or add small comments through the test?
@@ -59,6 +59,10 @@ public void Configure(string? name, JwtBearerOptions options) | |||
RoleClaimType = AuthenticationOptions.ROLE_CLAIM_TYPE | |||
}; | |||
|
|||
// TODO: The PR says "This (OAuth) also opens up a future direction should we need to handle special cases with EntraId." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how that would be a behavioral change? From my understanding (and correct me if I am wrong), EntraId will be the one that would need the behavioral changes in the future as it is EntraId the one that will handle the special cases.
Why make this change?
Closes #2407
This issue adds the
None
andOAuth
authentication providers. These are simple synonyms with no behavioural differences.What is this change?
Several enums/constants have been changed by adding
None
andOAuth
. Several places in the codebase have been changed to add if statements where necessary.Several tests have also been added.
How was this tested?
Sample Request(s)
Use the new
OAuth
authentication provider:Or
None
: