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 scheme to graph call, clean up unused method, add randomness to d… #1180

Merged
merged 3 commits into from
May 7, 2021

Conversation

jennyf19
Copy link
Collaborator

@jennyf19 jennyf19 commented May 6, 2021

…ev ap

@jmprieur i'm trying out some stuff w/the dev app, so it's okay to commit that, as i will probably make more changes once i hear back from asp.net core team on how to handle the sign-out. also, you were right on this LOL 😆 ...so we scratched it a bit too early from the list.

@jennyf19 jennyf19 requested a review from jmprieur May 6, 2021 01:36
Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

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

LGTM.
Great work.

Good idea to remove the default scheme and not use OpenIdConnectDefault.AuthenticationScheme in the test app. This is pure now.
and yes :) ... I couldn't figure out how the Graph could work without doing anything when the scheme was not the OpenIdConnectDefault.AuthenticationScheme. ... it didn't :)

@@ -10,7 +10,7 @@

namespace mvcwebapp_graph.Controllers
{
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
[Authorize(AuthenticationSchemes = "openid2")]
Copy link
Collaborator

@jmprieur jmprieur May 6, 2021

Choose a reason for hiding this comment

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

Maybe use a constant in this class for the Authentication scheme, as it starts to be used a lot :) #Resolved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed.

{
string scheme = OpenIdConnectDefaults.AuthenticationScheme;
// scheme ??= OpenIdConnectDefaults.AuthenticationScheme;
Copy link
Collaborator

@jmprieur jmprieur May 6, 2021

Choose a reason for hiding this comment

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

Good catch. Indeed, I think we'd want to remove this line #Pending

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think it's okay, if there is no scheme, it will use the default. we can discuss though.

@@ -44,8 +44,8 @@ public void ConfigureServices(IServiceCollection services)
.AddDownstreamWebApi("DownstreamB2CApi", Configuration.GetSection("DownstreamB2CApi"))
.AddInMemoryTokenCaches();

services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
o => o.ClientSecret = "");
//services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
Copy link
Collaborator

@jmprieur jmprieur May 6, 2021

Choose a reason for hiding this comment

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

Yes, we want to remove these lines completely :) #Resolved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i might leave, as it's the dev app, in case we want to test manually like this.

@jennyf19 jennyf19 merged commit 089395a into authSchemes May 7, 2021
jennyf19 added a commit that referenced this pull request May 19, 2021
* multiple auth schemes (#1157)

* initial commit for auth schemes

* update tests part 1

* add basic web app for testing

* updates to dev app

* more updates to dev app and downstreamapi

* update from merge conflict

* update app integration tests

* few more updates

* merge options partial idea (#1162)

* merge options partial idea

* fix tests

* fix warnings

* fix validate options

* fix credscan (#1172)

* fix policheck

* more updates to mergedoptions (#1177)

* another possiblity for merged options

* fix issue w/post configure

* fix tests

* fix a few more tests

* fix warnings

* fix integration tests

* update merged options

* fix warnings

* fix push

* add scheme to graph call, clean up unused method, add randomness to d… (#1180)

* add scheme to graph call, clean up unused method, add randomness to dev ap

* fix warnings

* PR feedback & fix sign-out

* add auth scheme integration tests (#1189)

* add auth scheme integration tests

* few more updates

* few more updates

* Adding the merged options generator

* Adding generated methods for merged options

* Removing code that isn't necessary

* Taking into account the JwtBearer options
(actually the authority) into the Microsoft
identity options if needed.

* Adding the Merged options generator to
the solution

* few more updates

Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>

* fix merge conflict

* clean-up, pr feedback

Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>
@jennyf19 jennyf19 deleted the jennyf/signOut branch May 31, 2021 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants