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

Adding support for .net 6 simplified templates apps #1736

Merged
merged 1 commit into from
May 17, 2022

Conversation

jmprieur
Copy link
Collaborator

@jmprieur jmprieur commented May 17, 2022

Fixes #1529 and #1708

Problem:

  • in .NET 6.0 the project templates for web apps and web APIs were simplified, and the content of the startup.cs moved to program.cs.
  • msidentity-app-sync was looking for Microsoft.identity.web method calls in startup.cs.

Fix:

  • Augment the project descriptions for web apps and web APIs, so that net 6.0 project templates are supported (in addition to .NET 5.0 and netcoreapp3.1
  • Bump-up the version of the tool to 1.0.1 (it's a kind of bug fix to react to environment changes)
  • Updates the Readme.md

How to test:

  1. Unregister the current msidentity-app-sync tool:
dotnet tool uninstall --global msidentity-app-sync
  1. In the folder where the app-provisioning.sln solution is located, pack the tool:
dotnet pack app-provisioning.sln
  1. Install the newly built tool (from the same folder)
dotnet tool install --global --add-source .\app-provisioning-tool\nupkg msidentity-app-sync
msidentity-app-sync --version
  1. Test:
dotnet new webapp --auth IndividualB2C ^
 --aad-b2c-instance "https://fabrikamb2c.b2clogin.com" ^
 --domain "fabrikamb2c.onmicrosoft.com" ^
 --called-api-url "https://fabrikamb2chello.azurewebsites.net/hello" ^
 --called-api-scopes "https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read"

 msidentity-app-sync

 dotnet run

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

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

This is awesome! :shipit:

@jmprieur jmprieur merged commit bb2d213 into master May 17, 2022
@jennyf19 jennyf19 deleted the jmprieur/app-sync-tool-for-net6 branch May 17, 2022 17:08
jennyf19 added a commit that referenced this pull request Jun 8, 2022
* update xml (#1719)

* update lab cert thumbprint (#1718)

* changelog 1.24.1 (#1720)

* Create TokenAcquisitionAppTokenCredential.cs (#1722)

Extends Azure ADK support to include requesting tokens as the app.

This is a copy of TokenAcquisitionTokenCredential.cs with changes to class name and changes to use _tokenAcquisition.GetAuthenticationResultForAppAsync() instead of GetAuthenticationResultForUserAsync().

* fix build, add using (#1729)

* fix build, add using

* add header in test

* Adding support for .net 6 simplified templates apps (#1736)

* Jennyf/scopes roles (#1742)

* initial commit for app permissions

* add test coverage

* remove IEnumerable and use string[]

* PR comments

* IJwtBearerMiddlewareDiagnostics from singleton to transient (#1741)

* fix tests after merge from fork (#1744)

* fix for 1738 (#1743)

* changelog for 1.25 (#1747)

* update testing files to 1.25 (#1748)

* update to wilson 6.19 (#1749)

* fix: include StatusCode in HttpRequestException for .NET 5 (#1750)

* update XML (#1751)

* try 5.0.0 for config.binder in OWIN to resolve issue

* don't build owin sample

* add condition

* remove release mode

Co-authored-by: Chris Brooks <cbrooks@microsoft.com>
Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>
Co-authored-by: sciocoder <sciocoder@hotmail.it>
Co-authored-by: Herman Jensen <hjanimations@hotmail.com>
jennyf19 added a commit that referenced this pull request Jul 24, 2022
* Initial version.
Needs a few updates to unit tests

* Updating the tests.

* - Adding a plain dotnet token acquisition host.
- AddTokenAcquisition now callable from net462
- AddGraph calllable from net462
- Adding a daemon sample using Id.Web.

* - Adding a plain dotnet token acquisition host.
- AddTokenAcquisition now callable from net462
- AddGraph calllable from net462
- Adding a daemon sample using Id.Web.

* Add a daemon-net6 sample / test

* Moving ITokenAcquirer and TokenAcquisitionOptions to
Microsoft.Identity.Web.TokenAcquisition.Abstractions

* Update

* Update

* - Simplifying the experience for the .NET 46x case (remove the need for specifying "OpendIdConnect" as an auth scheme, which didn't make sense.
- Fixing MergeOptions.Instance (was not set)
- Addressing PR feedback
- Adding missing XML comments
- Updaring tests now that there is a new interface (ITokenAcquirer)

* Updarting the OWIN sample

* Merging the OWIN implementation (only for web APIs for the moment)

* Solving build issues

* Supporting several authentication schemes in the same controller action / request
#1560

* Supporting several authentication schemes in the same controller action / request
#1560

* Adding a new assembly Microsoft.Identity.Web.TokenAcquisition
Moving types from Id.Web to the new assembly
 CONS:
- a lot of friend relationships.
- some constants should be split between id.web.tokenacquisition and Id.Web

* Fixing warnings

* Update dotnetcore.yml

* Update dotnetcore.yml

* Update dotnetcore.yml

* Update Microsoft.Identity.Web.sln

* Avoid building the OWIN web API in any CPU config

* Adding a TokenAcquirerFactory and a specialization for OWIN.

* Adding a factory from the configuration and services

* Updating the interfaces based on the discussions

* Adding the IDowstreamRestApi

* Update POC with master (#1752)

* update xml (#1719)

* update lab cert thumbprint (#1718)

* changelog 1.24.1 (#1720)

* Create TokenAcquisitionAppTokenCredential.cs (#1722)

Extends Azure ADK support to include requesting tokens as the app.

This is a copy of TokenAcquisitionTokenCredential.cs with changes to class name and changes to use _tokenAcquisition.GetAuthenticationResultForAppAsync() instead of GetAuthenticationResultForUserAsync().

* fix build, add using (#1729)

* fix build, add using

* add header in test

* Adding support for .net 6 simplified templates apps (#1736)

* Jennyf/scopes roles (#1742)

* initial commit for app permissions

* add test coverage

* remove IEnumerable and use string[]

* PR comments

* IJwtBearerMiddlewareDiagnostics from singleton to transient (#1741)

* fix tests after merge from fork (#1744)

* fix for 1738 (#1743)

* changelog for 1.25 (#1747)

* update testing files to 1.25 (#1748)

* update to wilson 6.19 (#1749)

* fix: include StatusCode in HttpRequestException for .NET 5 (#1750)

* update XML (#1751)

* try 5.0.0 for config.binder in OWIN to resolve issue

* don't build owin sample

* add condition

* remove release mode

Co-authored-by: Chris Brooks <cbrooks@microsoft.com>
Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>
Co-authored-by: sciocoder <sciocoder@hotmail.it>
Co-authored-by: Herman Jensen <hjanimations@hotmail.com>

* Update names and provide a class diagram

* Addressing Brent's feedback

* Taking into account the discussions Brent/Jm from 6/13

* Attempt to reconcile ClaimsPrincipal and S2SAuthenticationTicket

* Improving the CredentialDescription.
Splitting ApplicationIdentityOptions and AadIdentityOptions

* Renaming TokenAcquirerOptions to AcquireTokenOptions

* Renaming agreed with Brent

* Adressing more feedback

* Update based on decisions made with Brent 6/17

* Fixing XML comments and adding folders in TokenAcquisition.Abstractions

* Renamings + clean-up abstractions

* Moving the MicrosotAuthenticationTicket
and MicrosoftClaimsIdentity classes to Ms.Id.Web.TokenAcquisition (out of the
abstraction) and enabling the real SecurityToken type

* Adding Graph extensibility

* Update Microsoft.Identity.Web.Certificate
to be backwards compatible in 2.0 with
1.x

* add Owin web app (#1753)

* add Owin web app

* fix build error due to package ref

* update package reference

* update web.Config

* fix pckg ref

* update web.config

* remove from release

* update new dlls with directory.build.props (#1807)

* update new dlls with directory.build.props

* Updating the Web.Config assembly bindings
in the ASP.NET OWIN Web app

* Updating the folder name for the daemon app

* PR feedback

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

* ID.Web.MicrosoftGraph now eferences Id.Web.TokenAcqusition (and not Id.Web) (#1810)

* - In AuthenticationOptions and MicrosoftAuthenticationOptions, move properties were they should have been in the first place (when AAD specific)
- Move LoggingOptions to Ms.Id.Web.TokenAcquisition
- MicrosoftIdentityBaseAuthenticationBuilder and MicrosoftIdentityAppCallingWebApiAuthenticationBuilder move to Ms.Id.Web.TokenAcquisition
- Session methods of MicrosoftIdentityAppCallingWebApiAuthenticationBuilder move to an extension method
- TokenAcquisitionAspNetCore inherits from TokenAcquisition instead of being a partial class implementation (Could move to another assembly if we choose to)
- AddTokenAcquisition now register ITokenAcquirer (And only this one in the case of framework others than .NET Core)

* - OwinWebApi now is 472
- OwinWebApp updates to Web.Config and project
- Ms.Id.Web.MicrosoftGraph now references Ms.Id.Web.TokenAcquisition
(no longer Ms.Id.Web)

* PR review

* Adressing PR comment

* address PR comments

* small edits

* PR feedback and renaming

* fix build issues

* address governance issues
GHSA-5crp-9r3c-p9vr

Co-authored-by: jennyf19 <jeferrie@microsoft.com>
Co-authored-by: Chris Brooks <cbrooks@microsoft.com>
Co-authored-by: sciocoder <sciocoder@hotmail.it>
Co-authored-by: Herman Jensen <hjanimations@hotmail.com>
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.

msidentity-app-syn needs to support .NET 6 simplified templates
2 participants