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 SuperOffice provider #417

Merged
merged 137 commits into from
Jul 7, 2020
Merged

Add SuperOffice provider #417

merged 137 commits into from
Jul 7, 2020

Conversation

AnthonyYates
Copy link
Contributor

Add SuperOffice provider and unit tests.
Update README.md

@martincostello martincostello linked an issue May 4, 2020 that may be closed by this pull request
AnthonyYates and others added 16 commits May 4, 2020 15:09
…perOfficeConfigurationManager.cs

Co-authored-by: Martin Costello <martin@martincostello.com>
…nConfiguration.cs

Co-authored-by: Martin Costello <martin@martincostello.com>
…nConstants.cs


Spelling correction.

Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Updates project content based on PR feedback.
Updated comment based on PR feedback.
Copy link
Contributor Author

@AnthonyYates AnthonyYates left a comment

Choose a reason for hiding this comment

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

Hi Martin,
Thanks for all the comments and suggestions. I believe I have either corrected everything or commented accordingly and am awaiting any further comments.

Best regards!

SuperOfficeDevNet and others added 2 commits May 4, 2020 18:39
Prevents duplicate claims with signin/signout/signin scenario.
Co-authored-by: Martin Costello <martin@martincostello.com>
@kevinchalet
Copy link
Member

Hey @AnthonyYates!

Thanks for your contribution 👏

I took a brief look and wouah, it will be a lot of code to maintain (like the Apple provider) 😭
Assuming SuperOffice implements standard-compliant OAuth 2.0/OpenID Connect provider discovery, we should instead consider using IdentityModel's ConfigurationManager (Microsoft.IdentityModel.Protocols.OpenIdConnect).

https://github.com/dotnet/aspnetcore/blob/master/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectPostConfigureOptions.cs#L71-L102

Hard-coded JWKS URI instead of utilizing open-id configuration to determine jwks URL.
@AnthonyYates
Copy link
Contributor Author

AnthonyYates commented Jul 2, 2020

The sample application, using my provider, works just fine with System.IdentityModel.Tokens.Jwt from version 5.4.0, it's just the tests fail when calling Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted); . Bumping it to 5.6.0 makes my local tests pass, but appveyor and travis-ci seem to have issues with it. It causes the Apple test to fail.

Going to put the props to 5.4.0... maybe it's just my local environment that has issues...

@martincostello
Copy link
Member

martincostello commented Jul 2, 2020

Are you correctly rebased onto dev? It might be that your branch doesn't have the fix integrated from #439.

As I get this in the GitHub UI, this would suggest to me that it's not been rebased appropriately:

image

As we squash merge big PRs anyway, there's nothing to lose by squashing this PR down into one commit locally based on the current dev branch, and then force pushing.

@AnthonyYates
Copy link
Contributor Author

Maybe not? When I visited this page earlier today I discovered there were two conflicts. So I fixed them here on Github and committed them.

That's what I started to convert the rest of my solution to the new additions such as Directory.Packages.props.

I see I have both commits from #439
image

Tempted to save what I have and start this whole PR from scratch - clean slate.

@AnthonyYates
Copy link
Contributor Author

@martincostello , I think I got the conflict fixed. Can you verify that from your side? Also, it seems you have made some build/testing changes I'm not familiar with, and do not know how that is meant to impact my PR.

I updated the IdentityModel packages to 5.6.0, and all tests are passing. I did have to alter one Apple test, but only specify the complete namespace for an expected exception. Unsure why the type wasn't resolving correctly since the namespace was declared at the top.

Any advice the automated build error message "The project file could not be loaded. Data at the root level is invalid."?

AspNet.Security.OAuth.Providers.sln Show resolved Hide resolved
Directory.Packages.props Outdated Show resolved Hide resolved
@martincostello
Copy link
Member

If you run build.cmd or build.sh locally, you should be able to find compilation errors and/or test failures before commiting.

@AnthonyYates
Copy link
Contributor Author

@martincostello , thanks for the tip(s)! Unfortunately running local build.cmd doesn't shed any light on compilation errors in the PR.

image

@martincostello
Copy link
Member

Ah yes, sorry, you need to add the -test argument to run the tests too.

@kevinchalet
Copy link
Member

@martincostello should we tweak the build workflow to always upload the xUnit results even if the tests didn't pass?

@martincostello
Copy link
Member

Can do. The old one used to, but if the new one doesn’t it must’ve got accidentally lost in the migration to GH Actions.

@AnthonyYates
Copy link
Contributor Author

OK, Test errors are AppleTests.

When run in VS, they all but one pass:
image

Interestingly, when run in debug mode, it green lights.

image

However, running tests with build.cmd -test produces more failed tests:

Can_Sign_In_Using_Apple_With_Client_Secret
Can_Sign_In_Using_Apple_With_Private_Key
Cannot_Sign_In_Using_Apple_With_Expired_Token
Cannot_Sign_In_Using_Apple_With_Invalid_Token_Audience
Cannot_Sign_In_Using_Apple_With_Invalid_Token_Issuer

Mostly related to SecurityTokenInvalidSignatureException

@martincostello
Copy link
Member

Based on this announcement, maybe we should just use 5.5.0 as the minimum, which is the built-in version for 3.1?

aspnet/Announcements#428

@AnthonyYates
Copy link
Contributor Author

@martincostello If you can make the AppleTests succeed with 5.5.0, so be it!

@martincostello
Copy link
Member

Looks like something is different in 5.5.0 that disrupts the timing/sequencing in some way (caching?), so that configuration options associated with previous tests are being leftover or something.

I'll look into it when I have the time to do so. Otherwise, either you can look into it and fix it if you have the time, or otherwise downgrade to 5.4.0 if you can get the SuperOffice package to work with that version.

@martincostello
Copy link
Member

I've found the problem. I'll push up a fix some time later today. TL;DR - a fix similar to #439 needs to be done elsewhere in the code.

@martincostello
Copy link
Member

Fixes are now in dev.

@AnthonyYates
Copy link
Contributor Author

OK, great! Didn't have time today to get into it... Will update things now.

@AnthonyYates
Copy link
Contributor Author

Excellent @martincostello! Seems everything is good to go now. Appreciate your efforts and work on this PR, can't thank you enough.

@kevinchalet kevinchalet merged commit 75ebd13 into aspnet-contrib:dev Jul 7, 2020
@kevinchalet
Copy link
Member

Merged, thanks for your contribution.

@kevinchalet kevinchalet added this to the 3.1.2 milestone Jul 7, 2020
@martincostello
Copy link
Member

I’ll look at prepping the 3.1.2 release to ship this to NuGet.org when I get some time tomorrow, probably in the evening.

In the meantime you can consume the prerelease version from our MyGet feed 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add SuperOffice provider
4 participants