diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index db29a16b0..96da75c0c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,10 +9,10 @@ ] }, "dotnet-ef": { - "version": "3.1.0", + "version": "8.0.11", "commands": [ "dotnet-ef" ] } } -} \ No newline at end of file +} diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index bdea35305..7c74c36a8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,7 +6,7 @@ Then we can decide if and how a feature or a change could be implemented and if Also read this first: [Being a good open source citizen](https://hackernoon.com/being-a-good-open-source-citizen-9060d0ab9732#.x3hocgw85) ## Found an issue or a bug? -Please start a discussion on the [core repo issue tracker](https://github.com/IdentityServer/IdentityServer4/issues). +Please start a discussion on the [repository issue tracker](https://github.com/joneja09/IdentityServer4/issues). ## Filing issues The best way to get your bug fixed is to be as detailed as you can be about the problem. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fde5e98f..40aa3785e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: - main - features/** + - cursor/** tags: - '*.*.*' pull_request: @@ -21,8 +22,18 @@ jobs: name: ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@af513c7a016048ae468971c52ed77d9562c7c819 + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 10.0.x - run: dotnet --info + + - name: Upgrade script tests + if: contains(matrix.runs-on, 'macOS') || contains(matrix.runs-on, 'ubuntu') + working-directory: scripts/upgrade-namespaces + run: python3 test_rewrite.py - if: contains(matrix.runs-on, 'macOS') || contains(matrix.runs-on, 'ubuntu') run: ./build.sh diff --git a/.gitignore b/.gitignore index 43c53a29f..78fb2c350 100644 --- a/.gitignore +++ b/.gitignore @@ -211,4 +211,8 @@ samples/KeyManagement/FileSystem/signingkeys/ workspace.xml src/IdentityServer4/host/identityserver.db -tempkey.jwk \ No newline at end of file +tempkey.jwk + +# Python (upgrade script tests) +__pycache__/ +*.py[cod] diff --git a/NuGet.config b/NuGet.config index a347cc617..37f2edde1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/README.md b/README.md index 6e5570aa1..b40e86fe7 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,88 @@ -# Security Vulnerability Found -IdentityServer4 contains a known Open Redirect vulnerability (CVE-2024-39694) that we do not intend to address in IdentityServer4. Please see [the security advisory](https://github.com/IdentityServer/IdentityServer4/security/advisories/GHSA-55p7-v223-x366) for more details and consider upgrading to [Duende.IdentityServer](www.duendesoftware.com) to receive updates. +# ForgePoint.Identity -# Important update -This project is not maintained anymore. This repo will be archived when .NET Core 3.1 end of support is reached (13th Dec 2022). All new development is happening in the new [Duende Software](https://github.com/duendesoftware) organization. +ForgePoint.Identity is a free, open source [OpenID Connect](https://openid.net/connect/) and [OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc6749) framework for ASP.NET Core. It is maintained by **ForgePoint Labs** as an Apache-2.0 continuation of the last IdentityServer4 release, upgraded for current .NET and expanded with protocol and hosting features that modern apps expect. -See [here](https://duendesoftware.com/products/identityserver) for more details. +It remains licensed under [Apache 2.0](https://opensource.org/licenses/Apache-2.0). This project is not affiliated with or endorsed by Duende Software or the original IdentityServer4 authors. -## About IdentityServer4 -[](https://dotnetfoundation.org/projects?searchquery=IdentityServer&type=project) +`AddIdentityServer()` stays the same. C# namespaces move from `IdentityServer4.*` to `ForgePoint.Identity.*` — see the [upgrade guide](docs/upgrade.md) and `scripts/upgrade-namespaces`. -IdentityServer is a free, open source [OpenID Connect](http://openid.net/connect/) and [OAuth 2.0](https://tools.ietf.org/html/rfc6749) framework for ASP.NET Core. -Founded and maintained by [Dominick Baier](https://twitter.com/leastprivilege) and [Brock Allen](https://twitter.com/brocklallen), IdentityServer4 incorporates all the protocol implementations and extensibility points needed to integrate token-based authentication, single-sign-on and API access control in your applications. -IdentityServer4 is officially [certified](https://openid.net/certification/) by the [OpenID Foundation](https://openid.net) and thus spec-compliant and interoperable. -It is part of the [.NET Foundation](https://www.dotnetfoundation.org/), and operates under their [code of conduct](https://www.dotnetfoundation.org/code-of-conduct). It is licensed under [Apache 2](https://opensource.org/licenses/Apache-2.0) (an OSI approved license). +## What's new in 10.x -For project documentation, please visit [readthedocs](https://identityserver4.readthedocs.io). +- **ForgePoint.Identity** package IDs and `ForgePoint.Identity.*` namespaces (was IdentityServer4) +- Upgrade script for existing apps: `scripts/upgrade-namespaces` +- **.NET 8 and .NET 10** target frameworks for all libraries +- **CVE-2024-39694** open-redirect fix in local URL validation +- **Pushed Authorization Requests** (RFC 9126) at `/connect/par` +- **Health checks** via `AddHealthChecks().AddIdentityServer()` +- **`IClock` / `TimeProvider`** instead of the removed ASP.NET `ISystemClock` +- **Handwritten EF entity/model mappings** instead of AutoMapper (no AutoMapper license required) +- Package and test dependencies updated for current .NET -## Branch structure -Active development happens on the main branch. This always contains the latest version. Each (pre-) release is tagged with the corresponding version. The [aspnetcore1](https://github.com/IdentityServer/IdentityServer4/tree/aspnetcore1) and [aspnetcore2](https://github.com/IdentityServer/IdentityServer4/tree/aspnetcore2) branches contain the latest versions of the older ASP.NET Core based versions. +Duende IdentityServer is the commercial successor of the original IdentityServer project. + +## Packages + +| Package | Role | +| --- | --- | +| `ForgePoint.Identity` | Protocol implementation and ASP.NET Core host integration | +| `ForgePoint.Identity.Storage` | Store contracts and models | +| `ForgePoint.Identity.EntityFramework` | EF Core configuration and operational stores | +| `ForgePoint.Identity.EntityFramework.Storage` | EF Core entities and stores | +| `ForgePoint.Identity.AspNetIdentity` | ASP.NET Core Identity integration | ## How to build -* [Install](https://www.microsoft.com/net/download/core#/current) the latest .NET Core 3.1 SDK +* Install the [.NET 10 SDK](https://dotnet.microsoft.com/download) (the SDK also builds the `net8.0` TFM) * Install Git * Clone this repo -* Run `build.ps1` or `build.sh` in the root of the cloned repo +* Run `build.sh` or `build.ps1` from the repository root -## Documentation -For project documentation, please visit [readthedocs](https://identityserver4.readthedocs.io). +The build packs each project into `./nuget` in dependency order: Storage → Identity → EntityFramework.Storage → EntityFramework → AspNetIdentity. -See [here](http://docs.identityserver.io/en/aspnetcore1/) for the 1.x docs, and [here](http://docs.identityserver.io/en/aspnetcore2/) for the 2.x docs. +## Quick start -## Bug reports and feature requests -Please use the [issue tracker](https://github.com/IdentityServer/IdentityServer4/issues) for that. We only support the latest version for free. For older versions, you can get a commercial support agreement with us. +```csharp +builder.Services.AddIdentityServer(options => + { + options.Events.RaiseSuccessEvents = true; + options.Events.RaiseFailureEvents = true; + options.Events.RaiseErrorEvents = true; + options.PushedAuthorization.Required = false; // set true to require PAR globally + }) + .AddInMemoryClients(Clients.Get()) + .AddInMemoryIdentityResources(Resources.IdentityResources) + .AddInMemoryApiScopes(Resources.ApiScopes) + .AddDeveloperSigningCredential(); -## Commercial and Community Support -If you need help with implementing IdentityServer4 or your security architecture in general, there are both free and commercial support options. -See [here](https://identityserver4.readthedocs.io/en/latest/intro/support.html) for more details. +builder.Services.AddHealthChecks() + .AddIdentityServer(); -## Sponsorship -If you are a fan of the project or a company that relies on IdentityServer, you might want to consider sponsoring. -This will help us devote more time to answering questions and doing feature development. If you are interested please head to our [Patreon](https://www.patreon.com/identityserver) page which has further details. +app.UseIdentityServer(); +app.MapHealthChecks("/health"); +``` -### Platinum Sponsors -[](https://udelt.no) +Enable PAR per client with `Client.RequirePushedAuthorization = true`, or for every client with `options.PushedAuthorization.Required = true`. -[](https://github.com/dotnet-at-microsoft) +Existing IdentityServer4 4.x configuration databases need one additive column: -### Corporate Sponsors -[Ritter Insurance Marketing](https://www.ritterim.com) -[ExtraNetUserManager](https://www.extranetusermanager.com/) -[Knab](https://www.knab.nl/) +```sql +ALTER TABLE [Clients] ADD [RequirePushedAuthorization] bit NOT NULL DEFAULT 0; +``` + +A script is included at `docs/migrations/add-require-pushed-authorization.sql`. + +## Documentation -You can see a list of our current sponsors [here](https://github.com/IdentityServer/IdentityServer4/blob/main/SPONSORS.md) - and for companies we have some nice advertisement options as well. +Upgrade from IdentityServer4: [docs/upgrade.md](docs/upgrade.md). + +Historical IdentityServer4 docs: [https://identityserver4.readthedocs.io](https://identityserver4.readthedocs.io). + +PAR is described in [RFC 9126](https://www.rfc-editor.org/rfc/rfc9126). The discovery document advertises `pushed_authorization_request_endpoint` when the endpoint is enabled. + +## Security + +See [SECURITY.MD](SECURITY.MD). IdentityServer4 4.1.2 and earlier are affected by [CVE-2024-39694](https://github.com/IdentityServer/IdentityServer4/security/advisories/GHSA-55p7-v223-x366). This 10.x line includes the local-URL validation fix. ## Acknowledgements -IdentityServer4 is built using the following great open source projects and free services: - -* [ASP.NET Core](https://github.com/dotnet/aspnetcore) -* [Bullseye](https://github.com/adamralph/bullseye) -* [SimpleExec](https://github.com/adamralph/simple-exec) -* [MinVer](https://github.com/adamralph/minver) -* [Json.Net](http://www.newtonsoft.com/json) -* [XUnit](https://xunit.github.io/) -* [Fluent Assertions](http://www.fluentassertions.com/) -* [GitReleaseManager](https://github.com/GitTools/GitReleaseManager) - -..and last but not least a big thanks to all our [contributors](https://github.com/IdentityServer/IdentityServer4/graphs/contributors)! + +ForgePoint.Identity is built using ASP.NET Core, IdentityModel, Newtonsoft.Json, xUnit, Fluent Assertions, MinVer, Bullseye, and SimpleExec — and the work of [every contributor](https://github.com/IdentityServer/IdentityServer4/graphs/contributors) to the original IdentityServer4 project. diff --git a/SECURITY.MD b/SECURITY.MD index 8c8c1deae..903c4a3a1 100644 --- a/SECURITY.MD +++ b/SECURITY.MD @@ -1,7 +1,7 @@ # Reporting Security Issues -If you discover a security issue in IdentityServer, please report it by sending an email to contact@identityserver.io +If you discover a security issue in ForgePoint.Identity, please open a private GitHub security advisory on the repository. -This will allow us to assess the risk, and make a fix available before we add a bug report to the GitHub repository. +This 10.x line includes a fix for CVE-2024-39694 (open redirect via crafted local URLs). IdentityServer4 4.1.2 and earlier remain affected. -Thanks! +Do not file public issues for unreleased vulnerabilities until a fix is available. diff --git a/build.ps1 b/build.ps1 index ca4846c02..0e5f6427c 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,6 +1,14 @@ $ErrorActionPreference = "Stop"; -New-Item -ItemType Directory -Force -Path ./nuget +if (Test-Path ./nuget) { + Remove-Item ./nuget -Recurse -Force +} +New-Item -ItemType Directory -Force -Path ./nuget | Out-Null + +$nugetPackages = if ($env:NUGET_PACKAGES) { $env:NUGET_PACKAGES } else { Join-Path $env:USERPROFILE ".nuget\packages" } +Get-ChildItem -Path $nugetPackages -Directory -ErrorAction SilentlyContinue | + Where-Object { $_.Name -like "forgepoint.identity*" } | + Remove-Item -Recurse -Force dotnet tool restore diff --git a/build.sh b/build.sh index 512900faa..16b8d3e87 100755 --- a/build.sh +++ b/build.sh @@ -4,6 +4,11 @@ set -euo pipefail rm -rf nuget mkdir nuget +# Same-height MinVer packs reuse the global cache. Drop local ForgePoint.Identity +# packages so restore picks up the nupkgs just written to ./nuget. +nuget_packages="${NUGET_PACKAGES:-$HOME/.nuget/packages}" +rm -rf "$nuget_packages"/forgepoint.identity* + dotnet tool restore pushd ./src/Storage diff --git a/docs/migrations/add-require-pushed-authorization.sql b/docs/migrations/add-require-pushed-authorization.sql new file mode 100644 index 000000000..17d38a373 --- /dev/null +++ b/docs/migrations/add-require-pushed-authorization.sql @@ -0,0 +1,13 @@ +-- Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +-- Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + +-- Additive schema change for IdentityServer4 10: RFC 9126 PAR client flag. +-- Safe to run against existing IdentityServer4 4.x databases. + +IF COL_LENGTH('dbo.Clients', 'RequirePushedAuthorization') IS NULL +BEGIN + ALTER TABLE [dbo].[Clients] + ADD [RequirePushedAuthorization] bit NOT NULL + CONSTRAINT [DF_Clients_RequirePushedAuthorization] DEFAULT (0); +END +GO diff --git a/docs/readme.md b/docs/readme.md index 8590c8d5a..d268ac42b 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,4 +1,6 @@ -# IdentityServer4 documentation +# ForgePoint.Identity documentation + +Historical IdentityServer4 documentation lives in this folder and on [Read the Docs](https://identityserver4.readthedocs.io). ForgePoint.Identity keeps those APIs; new protocol features such as PAR are described in the repository README. The folder contains the documentation for identityserver4. diff --git a/docs/upgrade.md b/docs/upgrade.md new file mode 100644 index 000000000..0c207491c --- /dev/null +++ b/docs/upgrade.md @@ -0,0 +1,99 @@ +# Upgrade from IdentityServer4 to ForgePoint.Identity + +ForgePoint.Identity is a ForgePoint Labs Apache-2.0 continuation of IdentityServer4. APIs such as `AddIdentityServer()`, `IdentityServerOptions`, and `IdentityServerConstants` keep their type names. Package IDs and C# namespaces change. + +This project is not affiliated with or endorsed by Duende Software or the original IdentityServer4 authors. + +## 1. Swap NuGet packages + +| IdentityServer4 | ForgePoint.Identity | +| --- | --- | +| `IdentityServer4` | `ForgePoint.Identity` | +| `IdentityServer4.Storage` | `ForgePoint.Identity.Storage` | +| `IdentityServer4.EntityFramework` | `ForgePoint.Identity.EntityFramework` | +| `IdentityServer4.EntityFramework.Storage` | `ForgePoint.Identity.EntityFramework.Storage` | +| `IdentityServer4.AspNetIdentity` | `ForgePoint.Identity.AspNetIdentity` | + +```xml + +``` + +If you previously restored a local 10.x build of these packages, delete the matching folders under `~/.nuget/packages` (they are lowercase, for example `forgepoint.identity`) so restore does not reuse an older nupkg with the same MinVer version. + +## 2. Rewrite namespaces + +| IdentityServer4 | ForgePoint.Identity | +| --- | --- | +| `IdentityServer4` | `ForgePoint.Identity` | +| `IdentityServer4.Models` | `ForgePoint.Identity.Models` | +| `IdentityServer4.Stores` | `ForgePoint.Identity.Stores` | +| `IdentityServer4.EntityFramework` | `ForgePoint.Identity.EntityFramework` | +| `IdentityServer4.AspNetIdentity` | `ForgePoint.Identity.AspNetIdentity` | + +```csharp +using ForgePoint.Identity; +using ForgePoint.Identity.Models; + +builder.Services.AddIdentityServer() + .AddInMemoryClients(clients) + .AddDeveloperSigningCredential(); + +app.UseIdentityServer(); +``` + +`AddIdentityServer()`, `UseIdentityServer()`, and `AddHealthChecks().AddIdentityServer()` stay the same and still live in `Microsoft.Extensions.DependencyInjection`. + +## 3. Run the upgrade script + +From a clone of this repository (or copy `scripts/upgrade-namespaces` into your app): + +```bash +python3 scripts/upgrade-namespaces/rewrite.py /path/to/your/app --all --dry-run +python3 scripts/upgrade-namespaces/rewrite.py /path/to/your/app --all +``` + +or + +```bash +./scripts/upgrade-namespaces/upgrade.sh /path/to/your/app +``` + +```powershell +./scripts/upgrade-namespaces/upgrade.ps1 -Path C:\path\to\your\app +``` + +`--all` updates: + +- `.cs`, `.cshtml`, `.razor` namespace and `using` directives +- `.csproj` / `.props` / `.targets` `PackageReference`, `PackageVersion`, and `PackageId` values +- EF Core snapshots and migrations that store CLR type names as `IdentityServer4.EntityFramework.Entities.*` + +The script does **not** rename: + +- `AddIdentityServer`, `UseIdentityServer`, `IdentityServerOptions`, `IdentityServerConstants` +- `AssemblyName`, `RootNamespace`, `ProjectReference` paths, or `PackageTags` +- `InternalsVisibleTo("IdentityServer4...")` friend-test assemblies + +Review the diff, then build. + +This script is for consuming apps. Do not run `--packages` against this repository: on-disk project file names stay `IdentityServer4*.csproj` even though the NuGet package ids are `ForgePoint.Identity*`. + +## 4. Entity Framework + +Table names (`Clients`, `PersistedGrants`, and so on) do not change. Existing databases do not need a schema migration for the namespace rename. + +Do run the script over your `Migrations` folder so snapshots use `ForgePoint.Identity.EntityFramework.Entities.*`. After that, do **not** add a new EF migration just for the rename — that would generate a noisy no-op or a false table rebuild. + +IdentityServer4 4.x databases still need the PAR column if you use pushed authorization: + +```sql +ALTER TABLE [Clients] ADD [RequirePushedAuthorization] bit NOT NULL DEFAULT 0; +``` + +See `docs/migrations/add-require-pushed-authorization.sql`. + +## 5. What you should still do by hand + +- Authentication scheme strings such as `"IdentityServerAccessToken"` are unchanged +- Signing keys, connection strings, and client configuration stay as they are +- Host UI text that says “IdentityServer4” is cosmetic; the sample hosts in this repo already say ForgePoint.Identity diff --git a/global.json b/global.json index 70db89729..5269c28a5 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,7 @@ { "sdk": { - "version": "3.1.402" + "version": "10.0.400", + "rollForward": "latestFeature", + "allowPrerelease": false } -} \ No newline at end of file +} diff --git a/samples/Clients/Directory.Build.targets b/samples/Clients/Directory.Build.targets index 4eafc7731..6bde76de1 100644 --- a/samples/Clients/Directory.Build.targets +++ b/samples/Clients/Directory.Build.targets @@ -1,17 +1,17 @@ - 3.1.0 + 10.0.11 - + - + - \ No newline at end of file + diff --git a/samples/Clients/old/MvcHybrid/MvcHybrid.csproj b/samples/Clients/old/MvcHybrid/MvcHybrid.csproj index ff325c1aa..8a3cbca90 100644 --- a/samples/Clients/old/MvcHybrid/MvcHybrid.csproj +++ b/samples/Clients/old/MvcHybrid/MvcHybrid.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/old/MvcHybridAutomaticRefresh/MvcHybridAutomaticRefresh.csproj b/samples/Clients/old/MvcHybridAutomaticRefresh/MvcHybridAutomaticRefresh.csproj index 8bb5342bf..b40fcadcb 100644 --- a/samples/Clients/old/MvcHybridAutomaticRefresh/MvcHybridAutomaticRefresh.csproj +++ b/samples/Clients/old/MvcHybridAutomaticRefresh/MvcHybridAutomaticRefresh.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + net10.0 diff --git a/samples/Clients/old/MvcImplicit/MvcImplicit.csproj b/samples/Clients/old/MvcImplicit/MvcImplicit.csproj index a6270433d..ea4ce7800 100644 --- a/samples/Clients/old/MvcImplicit/MvcImplicit.csproj +++ b/samples/Clients/old/MvcImplicit/MvcImplicit.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/old/MvcImplicitJwtRequest/MvcImplicitJwtRequest.csproj b/samples/Clients/old/MvcImplicitJwtRequest/MvcImplicitJwtRequest.csproj index b2ddfdaa3..7d0577ec5 100644 --- a/samples/Clients/old/MvcImplicitJwtRequest/MvcImplicitJwtRequest.csproj +++ b/samples/Clients/old/MvcImplicitJwtRequest/MvcImplicitJwtRequest.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/old/MvcManual/MvcManual.csproj b/samples/Clients/old/MvcManual/MvcManual.csproj index 8c5d9381e..cde7d8455 100644 --- a/samples/Clients/old/MvcManual/MvcManual.csproj +++ b/samples/Clients/old/MvcManual/MvcManual.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/readme.md b/samples/Clients/readme.md index 9af1e703c..b1deaed0c 100644 --- a/samples/Clients/readme.md +++ b/samples/Clients/readme.md @@ -1,3 +1,3 @@ The client samples are designed to be used with the host in this repo: -https://github.com/IdentityServer/IdentityServer4/tree/main/src/IdentityServer4 +https://github.com/joneja09/IdentityServer4/tree/main/src/IdentityServer4 diff --git a/samples/Clients/src/APIs/ResourceBasedApi/ResourceBasedApi.csproj b/samples/Clients/src/APIs/ResourceBasedApi/ResourceBasedApi.csproj index ac693c034..63fb3d0f8 100644 --- a/samples/Clients/src/APIs/ResourceBasedApi/ResourceBasedApi.csproj +++ b/samples/Clients/src/APIs/ResourceBasedApi/ResourceBasedApi.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/src/APIs/SimpleApi/SimpleApi.csproj b/samples/Clients/src/APIs/SimpleApi/SimpleApi.csproj index c5e00c143..d7c065c32 100644 --- a/samples/Clients/src/APIs/SimpleApi/SimpleApi.csproj +++ b/samples/Clients/src/APIs/SimpleApi/SimpleApi.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/src/ConsoleClientCredentialsFlow/ConsoleClientCredentialsFlow.csproj b/samples/Clients/src/ConsoleClientCredentialsFlow/ConsoleClientCredentialsFlow.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleClientCredentialsFlow/ConsoleClientCredentialsFlow.csproj +++ b/samples/Clients/src/ConsoleClientCredentialsFlow/ConsoleClientCredentialsFlow.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleClientCredentialsFlowCallingIdentityServerApi/ConsoleClientCredentialsFlowCallingIdentityServerApi.csproj b/samples/Clients/src/ConsoleClientCredentialsFlowCallingIdentityServerApi/ConsoleClientCredentialsFlowCallingIdentityServerApi.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleClientCredentialsFlowCallingIdentityServerApi/ConsoleClientCredentialsFlowCallingIdentityServerApi.csproj +++ b/samples/Clients/src/ConsoleClientCredentialsFlowCallingIdentityServerApi/ConsoleClientCredentialsFlowCallingIdentityServerApi.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleClientCredentialsFlowPostBody/ConsoleClientCredentialsFlowPostBody.csproj b/samples/Clients/src/ConsoleClientCredentialsFlowPostBody/ConsoleClientCredentialsFlowPostBody.csproj index 37e808090..059e5f762 100644 --- a/samples/Clients/src/ConsoleClientCredentialsFlowPostBody/ConsoleClientCredentialsFlowPostBody.csproj +++ b/samples/Clients/src/ConsoleClientCredentialsFlowPostBody/ConsoleClientCredentialsFlowPostBody.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleCode/ConsoleCode.csproj b/samples/Clients/src/ConsoleCode/ConsoleCode.csproj index 9fe235fd8..a950c16e6 100644 --- a/samples/Clients/src/ConsoleCode/ConsoleCode.csproj +++ b/samples/Clients/src/ConsoleCode/ConsoleCode.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe ConsoleHybridWithPkce diff --git a/samples/Clients/src/ConsoleCustomGrant/ConsoleExtensionGrant.csproj b/samples/Clients/src/ConsoleCustomGrant/ConsoleExtensionGrant.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleCustomGrant/ConsoleExtensionGrant.csproj +++ b/samples/Clients/src/ConsoleCustomGrant/ConsoleExtensionGrant.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleDeviceFlow/ConsoleDeviceFlow.csproj b/samples/Clients/src/ConsoleDeviceFlow/ConsoleDeviceFlow.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleDeviceFlow/ConsoleDeviceFlow.csproj +++ b/samples/Clients/src/ConsoleDeviceFlow/ConsoleDeviceFlow.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleEphemeralMtlsClient/ConsoleEphemeralMtlsClient.csproj b/samples/Clients/src/ConsoleEphemeralMtlsClient/ConsoleEphemeralMtlsClient.csproj index 6d25d5464..c16673dd1 100644 --- a/samples/Clients/src/ConsoleEphemeralMtlsClient/ConsoleEphemeralMtlsClient.csproj +++ b/samples/Clients/src/ConsoleEphemeralMtlsClient/ConsoleEphemeralMtlsClient.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/src/ConsoleIntrospectionClient/ConsoleIntrospectionClient.csproj b/samples/Clients/src/ConsoleIntrospectionClient/ConsoleIntrospectionClient.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleIntrospectionClient/ConsoleIntrospectionClient.csproj +++ b/samples/Clients/src/ConsoleIntrospectionClient/ConsoleIntrospectionClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleMTLSClient/ConsoleMTLSClient.csproj b/samples/Clients/src/ConsoleMTLSClient/ConsoleMTLSClient.csproj index a49c13624..fc8593cbb 100644 --- a/samples/Clients/src/ConsoleMTLSClient/ConsoleMTLSClient.csproj +++ b/samples/Clients/src/ConsoleMTLSClient/ConsoleMTLSClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleParameterizedScopeClient/ConsoleParameterizedScopeClient.csproj b/samples/Clients/src/ConsoleParameterizedScopeClient/ConsoleParameterizedScopeClient.csproj index ed9a693e5..44aac9631 100644 --- a/samples/Clients/src/ConsoleParameterizedScopeClient/ConsoleParameterizedScopeClient.csproj +++ b/samples/Clients/src/ConsoleParameterizedScopeClient/ConsoleParameterizedScopeClient.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 ConsoleStructuredScopeClient diff --git a/samples/Clients/src/ConsolePrivateKeyJwtClient/ConsolePrivateKeyJwtClient.csproj b/samples/Clients/src/ConsolePrivateKeyJwtClient/ConsolePrivateKeyJwtClient.csproj index f0e8febe9..c303ce63b 100644 --- a/samples/Clients/src/ConsolePrivateKeyJwtClient/ConsolePrivateKeyJwtClient.csproj +++ b/samples/Clients/src/ConsolePrivateKeyJwtClient/ConsolePrivateKeyJwtClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleResourceOwnerFlow/ConsoleResourceOwnerFlow.csproj b/samples/Clients/src/ConsoleResourceOwnerFlow/ConsoleResourceOwnerFlow.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleResourceOwnerFlow/ConsoleResourceOwnerFlow.csproj +++ b/samples/Clients/src/ConsoleResourceOwnerFlow/ConsoleResourceOwnerFlow.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleResourceOwnerFlowPublic/ConsoleResourceOwnerFlowPublic.csproj b/samples/Clients/src/ConsoleResourceOwnerFlowPublic/ConsoleResourceOwnerFlowPublic.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleResourceOwnerFlowPublic/ConsoleResourceOwnerFlowPublic.csproj +++ b/samples/Clients/src/ConsoleResourceOwnerFlowPublic/ConsoleResourceOwnerFlowPublic.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleResourceOwnerFlowReference/ConsoleResourceOwnerFlowReference.csproj b/samples/Clients/src/ConsoleResourceOwnerFlowReference/ConsoleResourceOwnerFlowReference.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleResourceOwnerFlowReference/ConsoleResourceOwnerFlowReference.csproj +++ b/samples/Clients/src/ConsoleResourceOwnerFlowReference/ConsoleResourceOwnerFlowReference.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleResourceOwnerFlowRefreshToken/ConsoleResourceOwnerFlowRefreshToken.csproj b/samples/Clients/src/ConsoleResourceOwnerFlowRefreshToken/ConsoleResourceOwnerFlowRefreshToken.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleResourceOwnerFlowRefreshToken/ConsoleResourceOwnerFlowRefreshToken.csproj +++ b/samples/Clients/src/ConsoleResourceOwnerFlowRefreshToken/ConsoleResourceOwnerFlowRefreshToken.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/ConsoleResourceOwnerFlowUserInfo/ConsoleResourceOwnerFlowUserInfo.csproj b/samples/Clients/src/ConsoleResourceOwnerFlowUserInfo/ConsoleResourceOwnerFlowUserInfo.csproj index 96f882664..0d35ceb92 100644 --- a/samples/Clients/src/ConsoleResourceOwnerFlowUserInfo/ConsoleResourceOwnerFlowUserInfo.csproj +++ b/samples/Clients/src/ConsoleResourceOwnerFlowUserInfo/ConsoleResourceOwnerFlowUserInfo.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Clients/src/Constants/Constants.csproj b/samples/Clients/src/Constants/Constants.csproj index 0b6bb9964..2ca4caf41 100644 --- a/samples/Clients/src/Constants/Constants.csproj +++ b/samples/Clients/src/Constants/Constants.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net10.0 diff --git a/samples/Clients/src/JsOidc/JsOidc.csproj b/samples/Clients/src/JsOidc/JsOidc.csproj index ddeb61566..a2303458d 100644 --- a/samples/Clients/src/JsOidc/JsOidc.csproj +++ b/samples/Clients/src/JsOidc/JsOidc.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net10.0 \ No newline at end of file diff --git a/samples/Clients/src/MvcAutomaticTokenManagement/MvcAutomaticTokenManagement.csproj b/samples/Clients/src/MvcAutomaticTokenManagement/MvcAutomaticTokenManagement.csproj index a99418ded..c918fe7cb 100644 --- a/samples/Clients/src/MvcAutomaticTokenManagement/MvcAutomaticTokenManagement.csproj +++ b/samples/Clients/src/MvcAutomaticTokenManagement/MvcAutomaticTokenManagement.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/src/MvcCode/MvcCode.csproj b/samples/Clients/src/MvcCode/MvcCode.csproj index 906055867..21497c9b1 100644 --- a/samples/Clients/src/MvcCode/MvcCode.csproj +++ b/samples/Clients/src/MvcCode/MvcCode.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Clients/src/MvcHybridBackChannel/MvcHybridBackChannel.csproj b/samples/Clients/src/MvcHybridBackChannel/MvcHybridBackChannel.csproj index a6270433d..ea4ce7800 100644 --- a/samples/Clients/src/MvcHybridBackChannel/MvcHybridBackChannel.csproj +++ b/samples/Clients/src/MvcHybridBackChannel/MvcHybridBackChannel.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/KeyManagement/FileSystem/Config.cs b/samples/KeyManagement/FileSystem/Config.cs index 1b7a4c75c..bad157f93 100644 --- a/samples/KeyManagement/FileSystem/Config.cs +++ b/samples/KeyManagement/FileSystem/Config.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace sample diff --git a/samples/KeyManagement/FileSystem/FileSystemSample.csproj b/samples/KeyManagement/FileSystem/FileSystemSample.csproj index 05a7eebd1..3717ea4e4 100644 --- a/samples/KeyManagement/FileSystem/FileSystemSample.csproj +++ b/samples/KeyManagement/FileSystem/FileSystemSample.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net10.0 diff --git a/samples/KeyManagement/FileSystem/Program.cs b/samples/KeyManagement/FileSystem/Program.cs index 454300365..df8677ff4 100644 --- a/samples/KeyManagement/FileSystem/Program.cs +++ b/samples/KeyManagement/FileSystem/Program.cs @@ -15,7 +15,7 @@ public class Program { public static void Main(string[] args) { - Console.Title = "IdentityServer4"; + Console.Title = "ForgePoint.Identity"; CreateWebHostBuilder(args).Build().Run(); } diff --git a/samples/KeyManagement/FileSystem/Startup.cs b/samples/KeyManagement/FileSystem/Startup.cs index 78cd0e5ee..fa954be9e 100644 --- a/samples/KeyManagement/FileSystem/Startup.cs +++ b/samples/KeyManagement/FileSystem/Startup.cs @@ -41,7 +41,7 @@ public void ConfigureServices(IServiceCollection services) options => // configuring options is optional :) { options.DeleteRetiredKeys = true; - options.KeyType = IdentityServer4.KeyManagement.KeyType.RSA; + options.KeyType = ForgePoint.Identity.KeyManagement.KeyType.RSA; // all of these values in here are changed for local testing options.InitializationDuration = TimeSpan.FromSeconds(5); diff --git a/samples/KeyManagement/database/EF/Config.cs b/samples/KeyManagement/database/EF/Config.cs index 1b7a4c75c..bad157f93 100644 --- a/samples/KeyManagement/database/EF/Config.cs +++ b/samples/KeyManagement/database/EF/Config.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace sample diff --git a/samples/KeyManagement/database/EF/EfSample.csproj b/samples/KeyManagement/database/EF/EfSample.csproj index 4064271f5..b5836c378 100644 --- a/samples/KeyManagement/database/EF/EfSample.csproj +++ b/samples/KeyManagement/database/EF/EfSample.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/KeyManagement/database/EF/Program.cs b/samples/KeyManagement/database/EF/Program.cs index e01ccf8a7..5c52b389f 100644 --- a/samples/KeyManagement/database/EF/Program.cs +++ b/samples/KeyManagement/database/EF/Program.cs @@ -15,7 +15,7 @@ public class Program { public static void Main(string[] args) { - Console.Title = "IdentityServer4"; + Console.Title = "ForgePoint.Identity"; CreateWebHostBuilder(args).Build().Run(); } diff --git a/samples/KeyManagement/database/EF/Startup.cs b/samples/KeyManagement/database/EF/Startup.cs index 22bbcd3bd..9d29238d0 100644 --- a/samples/KeyManagement/database/EF/Startup.cs +++ b/samples/KeyManagement/database/EF/Startup.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using IdentityModel; -using IdentityServer4.KeyManagement.EntityFramework; +using ForgePoint.Identity.KeyManagement.EntityFramework; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; @@ -53,7 +53,7 @@ public void ConfigureServices(IServiceCollection services) options => // configuring options is optional :) { options.DeleteRetiredKeys = true; - options.KeyType = IdentityServer4.KeyManagement.KeyType.RSA; + options.KeyType = ForgePoint.Identity.KeyManagement.KeyType.RSA; // all of these values in here are changed for local testing options.InitializationDuration = TimeSpan.FromSeconds(5); diff --git a/samples/KeyManagement/database/migrations/Migrations/KeyManagement/20200327143521_KeyManagement.Designer.cs b/samples/KeyManagement/database/migrations/Migrations/KeyManagement/20200327143521_KeyManagement.Designer.cs index ebd569618..4d75f62ea 100644 --- a/samples/KeyManagement/database/migrations/Migrations/KeyManagement/20200327143521_KeyManagement.Designer.cs +++ b/samples/KeyManagement/database/migrations/Migrations/KeyManagement/20200327143521_KeyManagement.Designer.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.KeyManagement.EntityFramework; +using ForgePoint.Identity.KeyManagement.EntityFramework; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -21,7 +21,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.KeyManagement.EntityFramework.DataProtectionKey", b => + modelBuilder.Entity("ForgePoint.Identity.KeyManagement.EntityFramework.DataProtectionKey", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -48,7 +48,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("DataProtectionKeys"); }); - modelBuilder.Entity("IdentityServer4.KeyManagement.EntityFramework.SigningKey", b => + modelBuilder.Entity("ForgePoint.Identity.KeyManagement.EntityFramework.SigningKey", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/samples/KeyManagement/database/migrations/Migrations/KeyManagement/KeyManagementDbContextModelSnapshot.cs b/samples/KeyManagement/database/migrations/Migrations/KeyManagement/KeyManagementDbContextModelSnapshot.cs index a8ff2a820..f90d7ad25 100644 --- a/samples/KeyManagement/database/migrations/Migrations/KeyManagement/KeyManagementDbContextModelSnapshot.cs +++ b/samples/KeyManagement/database/migrations/Migrations/KeyManagement/KeyManagementDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.KeyManagement.EntityFramework; +using ForgePoint.Identity.KeyManagement.EntityFramework; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.KeyManagement.EntityFramework.DataProtectionKey", b => + modelBuilder.Entity("ForgePoint.Identity.KeyManagement.EntityFramework.DataProtectionKey", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -46,7 +46,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("DataProtectionKeys"); }); - modelBuilder.Entity("IdentityServer4.KeyManagement.EntityFramework.SigningKey", b => + modelBuilder.Entity("ForgePoint.Identity.KeyManagement.EntityFramework.SigningKey", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/samples/KeyManagement/database/migrations/Startup.cs b/samples/KeyManagement/database/migrations/Startup.cs index 6dd60c67a..23d300108 100644 --- a/samples/KeyManagement/database/migrations/Startup.cs +++ b/samples/KeyManagement/database/migrations/Startup.cs @@ -1,4 +1,4 @@ -using IdentityServer4.KeyManagement.EntityFramework; +using ForgePoint.Identity.KeyManagement.EntityFramework; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; diff --git a/samples/KeyManagement/database/migrations/migrations.csproj b/samples/KeyManagement/database/migrations/migrations.csproj index 2d2f7f408..6bb999ae0 100644 --- a/samples/KeyManagement/database/migrations/migrations.csproj +++ b/samples/KeyManagement/database/migrations/migrations.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/1_ClientCredentials/src/Api/Api.csproj b/samples/Quickstarts/1_ClientCredentials/src/Api/Api.csproj index 23c961295..0c78778c3 100644 --- a/samples/Quickstarts/1_ClientCredentials/src/Api/Api.csproj +++ b/samples/Quickstarts/1_ClientCredentials/src/Api/Api.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/1_ClientCredentials/src/Client/Client.csproj b/samples/Quickstarts/1_ClientCredentials/src/Client/Client.csproj index bb4d00cad..fb4cfb5f7 100644 --- a/samples/Quickstarts/1_ClientCredentials/src/Client/Client.csproj +++ b/samples/Quickstarts/1_ClientCredentials/src/Client/Client.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/Config.cs b/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/Config.cs index 3e7f9c06c..083bb5ce8 100644 --- a/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/Config.cs +++ b/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/Config.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServer diff --git a/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/IdentityServer.csproj b/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/IdentityServer.csproj index 2c24f15b1..fa8841478 100644 --- a/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/IdentityServer.csproj +++ b/samples/Quickstarts/1_ClientCredentials/src/IdentityServer/IdentityServer.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net10.0 - + diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/Api/Api.csproj b/samples/Quickstarts/2_InteractiveAspNetCore/src/Api/Api.csproj index 23c961295..0c78778c3 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/Api/Api.csproj +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/Api/Api.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/Client/Client.csproj b/samples/Quickstarts/2_InteractiveAspNetCore/src/Client/Client.csproj index bb4d00cad..fb4cfb5f7 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/Client/Client.csproj +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/Client/Client.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Config.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Config.cs index 8274c1899..32e1efbee 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Config.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Config.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServer diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/IdentityServer.csproj b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/IdentityServer.csproj index a9a0f20af..ecf71fde3 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/IdentityServer.csproj +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/IdentityServer.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net10.0 - + diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/AccountController.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/AccountController.cs index 2d51c3cd0..603872753 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/AccountController.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/AccountController.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -242,7 +242,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -344,7 +344,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/ExternalController.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/ExternalController.cs index 1a7479ea1..00c199652 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/ExternalController.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Account/ExternalController.cs @@ -1,9 +1,9 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ConsentController.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ConsentController.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Device/DeviceController.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Device/DeviceController.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Extensions.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Extensions.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Grants/GrantsController.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Grants/GrantsController.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/HomeController.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/HomeController.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/TestUsers.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/TestUsers.cs index 2acb95405..9f7392e09 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/TestUsers.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Quickstart/TestUsers.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; using System.Text.Json; -using IdentityServer4; +using ForgePoint.Identity; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Startup.cs b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Startup.cs index 73b7c59cd..4be753c97 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Startup.cs +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Startup.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; +using ForgePoint.Identity; using IdentityServerHost.Quickstart.UI; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Home/Index.cshtml b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Home/Index.cshtml +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

- Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

@@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Layout.cshtml b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Layout.cshtml +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Nav.cshtml b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Nav.cshtml +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/samples/Quickstarts/2_InteractiveAspNetCore/src/MvcClient/MvcClient.csproj b/samples/Quickstarts/2_InteractiveAspNetCore/src/MvcClient/MvcClient.csproj index 0b4f5ebd6..faa070f0d 100644 --- a/samples/Quickstarts/2_InteractiveAspNetCore/src/MvcClient/MvcClient.csproj +++ b/samples/Quickstarts/2_InteractiveAspNetCore/src/MvcClient/MvcClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/Api/Api.csproj b/samples/Quickstarts/3_AspNetCoreAndApis/src/Api/Api.csproj index 23c961295..0c78778c3 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/Api/Api.csproj +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/Api/Api.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/Client/Client.csproj b/samples/Quickstarts/3_AspNetCoreAndApis/src/Client/Client.csproj index bb4d00cad..fb4cfb5f7 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/Client/Client.csproj +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/Client/Client.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Config.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Config.cs index c81d979d2..61944abda 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Config.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Config.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServer diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/IdentityServer.csproj b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/IdentityServer.csproj index a9a0f20af..ecf71fde3 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/IdentityServer.csproj +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/IdentityServer.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net10.0 - + diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/AccountController.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/AccountController.cs index 2d51c3cd0..603872753 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/AccountController.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/AccountController.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -242,7 +242,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -344,7 +344,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/ExternalController.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/ExternalController.cs index 1a7479ea1..00c199652 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/ExternalController.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Account/ExternalController.cs @@ -1,9 +1,9 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ConsentController.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ConsentController.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Device/DeviceController.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Device/DeviceController.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Extensions.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Extensions.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Grants/GrantsController.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Grants/GrantsController.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/HomeController.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/HomeController.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/TestUsers.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/TestUsers.cs index 2acb95405..9f7392e09 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/TestUsers.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Quickstart/TestUsers.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; using System.Text.Json; -using IdentityServer4; +using ForgePoint.Identity; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Startup.cs b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Startup.cs index 73b7c59cd..4be753c97 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Startup.cs +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Startup.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; +using ForgePoint.Identity; using IdentityServerHost.Quickstart.UI; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Home/Index.cshtml b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Home/Index.cshtml +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Layout.cshtml b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Layout.cshtml +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Nav.cshtml b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Nav.cshtml +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/samples/Quickstarts/3_AspNetCoreAndApis/src/MvcClient/MvcClient.csproj b/samples/Quickstarts/3_AspNetCoreAndApis/src/MvcClient/MvcClient.csproj index 5e9da78ab..cf7c3ca2f 100644 --- a/samples/Quickstarts/3_AspNetCoreAndApis/src/MvcClient/MvcClient.csproj +++ b/samples/Quickstarts/3_AspNetCoreAndApis/src/MvcClient/MvcClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/4_JavaScriptClient/src/Api/Api.csproj b/samples/Quickstarts/4_JavaScriptClient/src/Api/Api.csproj index 23c961295..0c78778c3 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/Api/Api.csproj +++ b/samples/Quickstarts/4_JavaScriptClient/src/Api/Api.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/4_JavaScriptClient/src/Client/Client.csproj b/samples/Quickstarts/4_JavaScriptClient/src/Client/Client.csproj index bb4d00cad..fb4cfb5f7 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/Client/Client.csproj +++ b/samples/Quickstarts/4_JavaScriptClient/src/Client/Client.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Config.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Config.cs index 9d0530ce4..fe9921429 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Config.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Config.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServer diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/IdentityServer.csproj b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/IdentityServer.csproj index a9a0f20af..ecf71fde3 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/IdentityServer.csproj +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/IdentityServer.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net10.0 - + diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/AccountController.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/AccountController.cs index 2d51c3cd0..603872753 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/AccountController.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/AccountController.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -242,7 +242,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -344,7 +344,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/ExternalController.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/ExternalController.cs index 1a7479ea1..00c199652 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/ExternalController.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Account/ExternalController.cs @@ -1,9 +1,9 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ConsentController.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ConsentController.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Device/DeviceController.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Device/DeviceController.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Extensions.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Extensions.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Grants/GrantsController.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Grants/GrantsController.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/HomeController.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/HomeController.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/TestUsers.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/TestUsers.cs index 2acb95405..9f7392e09 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/TestUsers.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Quickstart/TestUsers.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; using System.Text.Json; -using IdentityServer4; +using ForgePoint.Identity; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Startup.cs b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Startup.cs index 73b7c59cd..4be753c97 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Startup.cs +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Startup.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; +using ForgePoint.Identity; using IdentityServerHost.Quickstart.UI; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Home/Index.cshtml b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Home/Index.cshtml +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Layout.cshtml b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Layout.cshtml +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Nav.cshtml b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Nav.cshtml +++ b/samples/Quickstarts/4_JavaScriptClient/src/IdentityServer/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/samples/Quickstarts/4_JavaScriptClient/src/JavaScriptClient/JavaScriptClient.csproj b/samples/Quickstarts/4_JavaScriptClient/src/JavaScriptClient/JavaScriptClient.csproj index 92605c5a1..45287e36e 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/JavaScriptClient/JavaScriptClient.csproj +++ b/samples/Quickstarts/4_JavaScriptClient/src/JavaScriptClient/JavaScriptClient.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/4_JavaScriptClient/src/MvcClient/MvcClient.csproj b/samples/Quickstarts/4_JavaScriptClient/src/MvcClient/MvcClient.csproj index 5e9da78ab..cf7c3ca2f 100644 --- a/samples/Quickstarts/4_JavaScriptClient/src/MvcClient/MvcClient.csproj +++ b/samples/Quickstarts/4_JavaScriptClient/src/MvcClient/MvcClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/5_EntityFramework/src/Api/Api.csproj b/samples/Quickstarts/5_EntityFramework/src/Api/Api.csproj index 23c961295..0c78778c3 100644 --- a/samples/Quickstarts/5_EntityFramework/src/Api/Api.csproj +++ b/samples/Quickstarts/5_EntityFramework/src/Api/Api.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/5_EntityFramework/src/Client/Client.csproj b/samples/Quickstarts/5_EntityFramework/src/Client/Client.csproj index bb4d00cad..fb4cfb5f7 100644 --- a/samples/Quickstarts/5_EntityFramework/src/Client/Client.csproj +++ b/samples/Quickstarts/5_EntityFramework/src/Client/Client.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Config.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Config.cs index c81d979d2..61944abda 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Config.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Config.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServer diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/20200625203625_InitialIdentityServerConfigurationDbMigration.Designer.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/20200625203625_InitialIdentityServerConfigurationDbMigration.Designer.cs index 711864e95..90c6c535a 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/20200625203625_InitialIdentityServerConfigurationDbMigration.Designer.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/20200625203625_InitialIdentityServerConfigurationDbMigration.Designer.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -21,7 +21,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -71,7 +71,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -93,7 +93,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -120,7 +120,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -142,7 +142,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -179,7 +179,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -219,7 +219,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -241,7 +241,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -268,7 +268,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -426,7 +426,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("Clients"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -453,7 +453,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -475,7 +475,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientCorsOrigins"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -497,7 +497,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientGrantTypes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -519,7 +519,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientIdPRestrictions"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -541,7 +541,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientPostLogoutRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -568,7 +568,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -590,7 +590,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -612,7 +612,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -649,7 +649,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -698,7 +698,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -720,7 +720,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -747,153 +747,153 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("Properties") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs index d07f43d26..ae686ad50 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -69,7 +69,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -91,7 +91,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -118,7 +118,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -140,7 +140,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -177,7 +177,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -217,7 +217,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -239,7 +239,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -266,7 +266,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -424,7 +424,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Clients"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -451,7 +451,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -473,7 +473,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientCorsOrigins"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -495,7 +495,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientGrantTypes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -517,7 +517,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientIdPRestrictions"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -539,7 +539,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientPostLogoutRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -566,7 +566,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -588,7 +588,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -610,7 +610,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -647,7 +647,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -696,7 +696,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -718,7 +718,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -745,153 +745,153 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("Properties") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/20200625203357_InitialIdentityServerPersistedGrantDbMigration.Designer.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/20200625203357_InitialIdentityServerPersistedGrantDbMigration.Designer.cs index 1ba1c2973..7e2bb2c3f 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/20200625203357_InitialIdentityServerPersistedGrantDbMigration.Designer.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/20200625203357_InitialIdentityServerPersistedGrantDbMigration.Designer.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -21,7 +21,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("nvarchar(200)") @@ -71,7 +71,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("DeviceCodes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("nvarchar(200)") diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs index 14a33f7eb..adf989bb0 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Data/Migrations/IdentityServer/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("nvarchar(200)") @@ -69,7 +69,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("DeviceCodes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("nvarchar(200)") diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/IdentityServer.csproj b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/IdentityServer.csproj index 771a8ff88..6e3f590a5 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/IdentityServer.csproj +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/IdentityServer.csproj @@ -1,11 +1,11 @@ - netcoreapp3.1 + net10.0 - + diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/AccountController.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/AccountController.cs index 2d51c3cd0..603872753 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/AccountController.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/AccountController.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -242,7 +242,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -344,7 +344,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/ExternalController.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/ExternalController.cs index 1a7479ea1..00c199652 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/ExternalController.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Account/ExternalController.cs @@ -1,9 +1,9 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ConsentController.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ConsentController.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Device/DeviceController.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Device/DeviceController.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Extensions.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Extensions.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Grants/GrantsController.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Grants/GrantsController.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/HomeController.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/HomeController.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/TestUsers.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/TestUsers.cs index 2acb95405..9f7392e09 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/TestUsers.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Quickstart/TestUsers.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; using System.Text.Json; -using IdentityServer4; +using ForgePoint.Identity; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Startup.cs b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Startup.cs index f0a0510ce..3b81a2fc9 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Startup.cs +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Startup.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Mappers; +using ForgePoint.Identity; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Mappers; using IdentityServerHost.Quickstart.UI; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -24,7 +24,7 @@ public void ConfigureServices(IServiceCollection services) services.AddControllersWithViews(); var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; - const string connectionString = @"Data Source=(LocalDb)\MSSQLLocalDB;database=IdentityServer4.Quickstart.EntityFramework-4.0.0;trusted_connection=yes;"; + const string connectionString = @"Data Source=(LocalDb)\MSSQLLocalDB;database=ForgePoint.Identity.Quickstart.EntityFramework-4.0.0;trusted_connection=yes;"; var builder = services.AddIdentityServer() .AddTestUsers(TestUsers.Users) diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Home/Index.cshtml b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Home/Index.cshtml +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Layout.cshtml b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Layout.cshtml +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Nav.cshtml b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Nav.cshtml +++ b/samples/Quickstarts/5_EntityFramework/src/IdentityServer/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/samples/Quickstarts/5_EntityFramework/src/MvcClient/MvcClient.csproj b/samples/Quickstarts/5_EntityFramework/src/MvcClient/MvcClient.csproj index 5e9da78ab..cf7c3ca2f 100644 --- a/samples/Quickstarts/5_EntityFramework/src/MvcClient/MvcClient.csproj +++ b/samples/Quickstarts/5_EntityFramework/src/MvcClient/MvcClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/6_AspNetIdentity/src/Api/Api.csproj b/samples/Quickstarts/6_AspNetIdentity/src/Api/Api.csproj index 23c961295..0c78778c3 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/Api/Api.csproj +++ b/samples/Quickstarts/6_AspNetIdentity/src/Api/Api.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/6_AspNetIdentity/src/Client/Client.csproj b/samples/Quickstarts/6_AspNetIdentity/src/Client/Client.csproj index bb4d00cad..fb4cfb5f7 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/Client/Client.csproj +++ b/samples/Quickstarts/6_AspNetIdentity/src/Client/Client.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 Exe diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Config.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Config.cs index b6710745d..430348cc8 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Config.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Config.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServerAspNetIdentity diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/IdentityServerAspNetIdentity.csproj b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/IdentityServerAspNetIdentity.csproj index 1c2597539..d8fa4023d 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/IdentityServerAspNetIdentity.csproj +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/IdentityServerAspNetIdentity.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net10.0 - + diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/AccountController.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/AccountController.cs index 04f1bc7eb..402c4e0f7 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/AccountController.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/AccountController.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using IdentityServerAspNetIdentity.Models; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; @@ -217,7 +217,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -319,7 +319,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/ExternalController.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/ExternalController.cs index bfa61b4bc..4c23a3099 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/ExternalController.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Account/ExternalController.cs @@ -4,10 +4,10 @@ using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using IdentityServerAspNetIdentity.Models; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ConsentController.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ConsentController.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ProcessConsentResult.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ProcessConsentResult.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Device/DeviceController.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Device/DeviceController.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Extensions.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Extensions.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Grants/GrantsController.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Grants/GrantsController.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/ErrorViewModel.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/ErrorViewModel.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/HomeController.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/HomeController.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/TestUsers.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/TestUsers.cs index b4d2f821f..fa1df9572 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/TestUsers.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Quickstart/TestUsers.cs @@ -3,7 +3,7 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; @@ -22,7 +22,7 @@ public class TestUsers new Claim(JwtClaimTypes.Email, "AliceSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://alice.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json) } }, new TestUser{SubjectId = "88421113", Username = "bob", Password = "bob", @@ -34,7 +34,7 @@ public class TestUsers new Claim(JwtClaimTypes.Email, "BobSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://bob.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json), new Claim("location", "somewhere") } } diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Startup.cs b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Startup.cs index 6d427a02b..e1e826092 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Startup.cs +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Startup.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; +using ForgePoint.Identity; using IdentityServerAspNetIdentity.Data; using IdentityServerAspNetIdentity.Models; using Microsoft.AspNetCore.Builder; diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Home/Index.cshtml b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Home/Index.cshtml +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Layout.cshtml b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Layout.cshtml +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Nav.cshtml b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Nav.cshtml +++ b/samples/Quickstarts/6_AspNetIdentity/src/IdentityServerAspNetIdentity/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/samples/Quickstarts/6_AspNetIdentity/src/MvcClient/MvcClient.csproj b/samples/Quickstarts/6_AspNetIdentity/src/MvcClient/MvcClient.csproj index 5e9da78ab..cf7c3ca2f 100644 --- a/samples/Quickstarts/6_AspNetIdentity/src/MvcClient/MvcClient.csproj +++ b/samples/Quickstarts/6_AspNetIdentity/src/MvcClient/MvcClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/samples/Quickstarts/Directory.Build.targets b/samples/Quickstarts/Directory.Build.targets index 1611f8603..7de65e333 100644 --- a/samples/Quickstarts/Directory.Build.targets +++ b/samples/Quickstarts/Directory.Build.targets @@ -1,14 +1,14 @@ - 3.1.5 + 10.0.11 - - - - + + + + @@ -16,8 +16,8 @@ - + - + - \ No newline at end of file + diff --git a/scripts/upgrade-namespaces/README.md b/scripts/upgrade-namespaces/README.md new file mode 100644 index 000000000..cbc8f3fd8 --- /dev/null +++ b/scripts/upgrade-namespaces/README.md @@ -0,0 +1,23 @@ +# ForgePoint.Identity upgrade scripts + +Rewrites IdentityServer4 package ids and C# namespaces to ForgePoint.Identity. + +Type names such as `AddIdentityServer` and `IdentityServerOptions` are not changed. Requires Python 3. + +```bash +python3 rewrite.py /path/to/your/app --all --dry-run +python3 rewrite.py /path/to/your/app --all +./upgrade.sh /path/to/your/app +``` + +```powershell +./upgrade.ps1 -Path C:\path\to\your\app +``` + +Run the tests with: + +```bash +python3 test_rewrite.py +``` + +See [docs/upgrade.md](../../docs/upgrade.md). diff --git a/scripts/upgrade-namespaces/rewrite.py b/scripts/upgrade-namespaces/rewrite.py new file mode 100755 index 000000000..9678b2906 --- /dev/null +++ b/scripts/upgrade-namespaces/rewrite.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +"""Rewrite IdentityServer4 namespaces (and optional package ids) to ForgePoint.Identity. + +Used both to migrate this repository and as the engine behind the consumer scripts. +Type names such as AddIdentityServer, IdentityServerOptions, and IdentityServerConstants +are left unchanged. +""" + +from __future__ import annotations + +import argparse +import os +import re +from pathlib import Path + +SKIP_DIR_NAMES = { + ".git", + "bin", + "obj", + "nuget", + "artifacts", + "node_modules", + "wwwroot", +} + +SOURCE_SUFFIXES = {".cs", ".cshtml", ".razor", ".fs", ".vb"} +PROJECT_SUFFIXES = {".csproj", ".fsproj", ".vbproj", ".props", ".targets"} + +# Longest-first so IdentityServer4.Storage does not become ForgePoint.Identity.Storage +# after a shorter IdentityServer4 replacement. +PACKAGE_REPLACEMENTS = ( + ("IdentityServer4.EntityFramework.Storage", "ForgePoint.Identity.EntityFramework.Storage"), + ("IdentityServer4.EntityFramework", "ForgePoint.Identity.EntityFramework"), + ("IdentityServer4.AspNetIdentity", "ForgePoint.Identity.AspNetIdentity"), + ("IdentityServer4.Storage", "ForgePoint.Identity.Storage"), + ("IdentityServer4", "ForgePoint.Identity"), +) + +FRIEND_ASSEMBLY_RE = re.compile(r'InternalsVisibleTo\(\s*"IdentityServer4[^"]*"') + +USING_LINE_RE = re.compile(r'(?m)^(\s*(?:@)?(?:global\s+)?using )IdentityServer4;') +USING_VB_RE = re.compile(r'(?m)^(\s*Imports )IdentityServer4(\r?\n)') +NAMESPACE_FILE_SCOPED_RE = re.compile(r'(?m)^(namespace )IdentityServer4;') +NAMESPACE_BLOCK_RE = re.compile(r'(?m)^(namespace )IdentityServer4(\r?\n| )') + + +def protect_friend_assemblies(text: str) -> tuple[str, list[tuple[str, str]]]: + saved: list[tuple[str, str]] = [] + + def repl(match: re.Match[str]) -> str: + token = f"___FP_IVT_{len(saved)}___" + saved.append((token, match.group(0))) + return token + + return FRIEND_ASSEMBLY_RE.sub(repl, text), saved + + +def restore_friend_assemblies(text: str, saved: list[tuple[str, str]]) -> str: + for token, original in saved: + text = text.replace(token, original) + return text + + +def rewrite_namespaces(text: str) -> str: + text, saved = protect_friend_assemblies(text) + + text = text.replace("IdentityServer4.", "ForgePoint.Identity.") + text = text.replace("global::IdentityServer4", "global::ForgePoint.Identity") + text = USING_LINE_RE.sub(r"\1ForgePoint.Identity;", text) + text = USING_VB_RE.sub(r"\1ForgePoint.Identity\2", text) + text = NAMESPACE_FILE_SCOPED_RE.sub(r"\1ForgePoint.Identity;", text) + text = NAMESPACE_BLOCK_RE.sub(r"\1ForgePoint.Identity\2", text) + + return restore_friend_assemblies(text, saved) + + +def rewrite_packages(text: str) -> str: + """Rewrite PackageReference / PackageVersion / PackageId only. + + AssemblyName, RootNamespace, ProjectReference paths, PackageTags, and + InternalsVisibleTo stay as they are so friend-test assemblies keep working. + """ + for old, new in PACKAGE_REPLACEMENTS: + text = text.replace(f'Include="{old}"', f'Include="{new}"') + text = text.replace(f"Include='{old}'", f"Include='{new}'") + text = text.replace(f'Update="{old}"', f'Update="{new}"') + text = text.replace(f"Update='{old}'", f"Update='{new}'") + text = text.replace(f"{old}", f"{new}") + return text + + +def should_skip_dir(name: str) -> bool: + return name in SKIP_DIR_NAMES + + +def iter_files(root: Path, suffixes: set[str]): + for dirpath, dirnames, filenames in os.walk(root): + dirnames[:] = [d for d in dirnames if not should_skip_dir(d)] + for filename in filenames: + path = Path(dirpath) / filename + if path.suffix.lower() in suffixes: + yield path + + +def rewrite_file(path: Path, namespaces: bool, packages: bool, dry_run: bool) -> bool: + original = path.read_text(encoding="utf-8") + updated = original + if namespaces: + updated = rewrite_namespaces(updated) + if packages: + updated = rewrite_packages(updated) + if updated == original: + return False + if not dry_run: + path.write_text(updated, encoding="utf-8") + return True + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("root", nargs="?", default=".", help="Solution or project directory") + parser.add_argument("--namespaces", action="store_true", default=False) + parser.add_argument("--packages", action="store_true", default=False) + parser.add_argument("--all", action="store_true", help="Rewrite namespaces and package ids") + parser.add_argument( + "--dry-run", + action="store_true", + help="Print files that would change without writing them", + ) + args = parser.parse_args() + + namespaces = args.namespaces or args.all + packages = args.packages or args.all + if not namespaces and not packages: + parser.error("Specify --namespaces, --packages, or --all") + + root = Path(args.root).resolve() + changed = 0 + prefix = "would update" if args.dry_run else "updated" + + if namespaces: + for path in iter_files(root, SOURCE_SUFFIXES): + if rewrite_file(path, namespaces=True, packages=False, dry_run=args.dry_run): + print(f"namespace {prefix} {path.relative_to(root)}") + changed += 1 + + if packages: + for path in iter_files(root, PROJECT_SUFFIXES): + if rewrite_file(path, namespaces=False, packages=True, dry_run=args.dry_run): + print(f"package {prefix} {path.relative_to(root)}") + changed += 1 + + print(f"{prefix.capitalize()} {changed} file(s) under {root}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/upgrade-namespaces/test_rewrite.py b/scripts/upgrade-namespaces/test_rewrite.py new file mode 100755 index 000000000..3bfff2ef3 --- /dev/null +++ b/scripts/upgrade-namespaces/test_rewrite.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +"""Tests for the IdentityServer4 → ForgePoint.Identity rewrite engine.""" + +from __future__ import annotations + +import unittest + +from rewrite import rewrite_namespaces, rewrite_packages + + +class NamespaceTests(unittest.TestCase): + def test_using_and_namespace(self) -> None: + source = ( + "using IdentityServer4;\n" + "using IdentityServer4.Models;\n" + "using IdentityServer4.Stores;\n" + "\n" + "namespace IdentityServer4.Hosting\n" + "{\n" + " public class Startup\n" + " {\n" + " public void ConfigureServices(IServiceCollection services)\n" + " {\n" + " services.AddIdentityServer();\n" + " }\n" + " }\n" + "}\n" + ) + updated = rewrite_namespaces(source) + self.assertIn("using ForgePoint.Identity;", updated) + self.assertIn("using ForgePoint.Identity.Models;", updated) + self.assertIn("using ForgePoint.Identity.Stores;", updated) + self.assertIn("namespace ForgePoint.Identity.Hosting", updated) + self.assertIn("services.AddIdentityServer();", updated) + self.assertNotIn("IdentityServer4", updated) + + def test_file_scoped_namespace_and_crlf(self) -> None: + source = "using IdentityServer4;\r\nnamespace IdentityServer4;\r\n" + updated = rewrite_namespaces(source) + self.assertEqual("using ForgePoint.Identity;\r\nnamespace ForgePoint.Identity;\r\n", updated) + + def test_global_using(self) -> None: + source = "global using IdentityServer4;\nglobal using IdentityServer4.Models;\n" + updated = rewrite_namespaces(source) + self.assertEqual( + "global using ForgePoint.Identity;\nglobal using ForgePoint.Identity.Models;\n", + updated, + ) + + def test_global_alias(self) -> None: + source = "typeof(global::IdentityServer4.Models.Client)" + self.assertEqual( + "typeof(global::ForgePoint.Identity.Models.Client)", + rewrite_namespaces(source), + ) + + def test_ef_snapshot_clr_names(self) -> None: + source = 'modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>' + updated = rewrite_namespaces(source) + self.assertIn("ForgePoint.Identity.EntityFramework.Entities.Client", updated) + + def test_friend_assemblies_are_preserved(self) -> None: + source = ( + '[assembly: InternalsVisibleTo("IdentityServer4.EntityFramework.UnitTests, PublicKey = ABC")]\n' + '[assembly: InternalsVisibleTo("IdentityServer4.EntityFramework.IntegrationTests")]\n' + "using IdentityServer4.EntityFramework;\n" + ) + updated = rewrite_namespaces(source) + self.assertIn('InternalsVisibleTo("IdentityServer4.EntityFramework.UnitTests, PublicKey = ABC")', updated) + self.assertIn('InternalsVisibleTo("IdentityServer4.EntityFramework.IntegrationTests")', updated) + self.assertIn("using ForgePoint.Identity.EntityFramework;", updated) + + def test_type_names_are_not_renamed(self) -> None: + source = ( + "builder.UseIdentityServer();\n" + "options.IdentityServerName = IdentityServerConstants.LocalApi.ScopeName;\n" + "services.AddHealthChecks().AddIdentityServer();\n" + ) + self.assertEqual(source, rewrite_namespaces(source)) + + +class PackageTests(unittest.TestCase): + def test_package_reference_longest_first(self) -> None: + source = """ + + + + + + + + + + + + IdentityServer4 + IdentityServer4.EntityFramework.UnitTests + IdentityServer4 + Identity;IdentityServer4 + + + + + +""" + updated = rewrite_packages(source) + self.assertIn('Include="ForgePoint.Identity.EntityFramework.Storage"', updated) + self.assertIn('Include="ForgePoint.Identity.EntityFramework"', updated) + self.assertIn('Include="ForgePoint.Identity.AspNetIdentity"', updated) + self.assertIn('Include="ForgePoint.Identity.Storage"', updated) + self.assertIn('Include="ForgePoint.Identity"', updated) + self.assertIn("ForgePoint.Identity", updated) + self.assertIn('Update="ForgePoint.Identity.Storage"', updated) + self.assertIn("IdentityServer4.EntityFramework.UnitTests", updated) + self.assertIn("IdentityServer4", updated) + self.assertIn("Identity;IdentityServer4", updated) + self.assertIn('Include="..\\src\\IdentityServer4.csproj"', updated) + self.assertNotIn('Include="IdentityServer4"', updated) + self.assertNotIn('Include="IdentityServer4.', updated) + + +if __name__ == "__main__": + unittest.main() diff --git a/scripts/upgrade-namespaces/upgrade.ps1 b/scripts/upgrade-namespaces/upgrade.ps1 new file mode 100644 index 000000000..5d329d155 --- /dev/null +++ b/scripts/upgrade-namespaces/upgrade.ps1 @@ -0,0 +1,36 @@ +# Rewrite IdentityServer4 package ids and namespaces to ForgePoint.Identity. +# Type names such as AddIdentityServer and IdentityServerOptions are not changed. + +param( + [string]$Path = ".", + [switch]$Namespaces, + [switch]$Packages, + [switch]$All, + [switch]$DryRun +) + +$ErrorActionPreference = "Stop" +$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path + +if (-not $Namespaces -and -not $Packages -and -not $All) { + $All = $true +} + +$python = Get-Command python3 -ErrorAction SilentlyContinue +if (-not $python) { + $python = Get-Command python -ErrorAction SilentlyContinue +} + +if (-not $python) { + throw "Python is required to run this upgrade script." +} + +$pythonArgs = @((Resolve-Path $Path).Path) +if ($All) { $pythonArgs += "--all" } +else { + if ($Namespaces) { $pythonArgs += "--namespaces" } + if ($Packages) { $pythonArgs += "--packages" } +} +if ($DryRun) { $pythonArgs += "--dry-run" } + +& $python.Source (Join-Path $scriptDir "rewrite.py") @pythonArgs diff --git a/scripts/upgrade-namespaces/upgrade.sh b/scripts/upgrade-namespaces/upgrade.sh new file mode 100755 index 000000000..cdf35a7c7 --- /dev/null +++ b/scripts/upgrade-namespaces/upgrade.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Rewrite IdentityServer4 package ids and/or namespaces to ForgePoint.Identity. +# Type names such as AddIdentityServer and IdentityServerOptions are not changed. + +ROOT="." +EXTRA=() +for arg in "$@"; do + if [[ "$arg" == --* ]]; then + EXTRA+=("$arg") + else + ROOT="$arg" + fi +done + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if command -v python3 >/dev/null 2>&1; then + python3 "$SCRIPT_DIR/rewrite.py" "$ROOT" --all "${EXTRA[@]}" + exit $? +fi + +echo "python3 is required to run this upgrade script." >&2 +exit 1 diff --git a/src/AspNetIdentity/README.md b/src/AspNetIdentity/README.md index 0c0f9bd9a..6f776e288 100644 --- a/src/AspNetIdentity/README.md +++ b/src/AspNetIdentity/README.md @@ -1,9 +1,9 @@ -# IdentityServer4.AspNetIdentity +# ForgePoint.Identity.AspNetIdentity -ASP.NET Core Identity integration support for IdentityServer4. +ASP.NET Core Identity integration for ForgePoint.Identity. -You can find a detailed walk-through for ASP.NET Core Identity integration [here](https://identityserver4.readthedocs.io/en/latest/quickstarts/6_aspnet_identity.html). +You can find a detailed walk-through for ASP.NET Core Identity integration in the historical IdentityServer4 docs: [https://identityserver4.readthedocs.io/en/latest/quickstarts/6_aspnet_identity.html](https://identityserver4.readthedocs.io/en/latest/quickstarts/6_aspnet_identity.html). ## Issues -For issues, use the [consolidated IdentityServer4 issue tracker](https://github.com/IdentityServer/IdentityServer4/issues). +Open issues on this repository. diff --git a/src/AspNetIdentity/build/Program.cs b/src/AspNetIdentity/build/Program.cs index 46a19ae28..71c58d642 100644 --- a/src/AspNetIdentity/build/Program.cs +++ b/src/AspNetIdentity/build/Program.cs @@ -2,6 +2,6 @@ { partial class Program { - private const string Prefix = "AspNetIdentity"; + private const string Prefix = "ForgePoint.Identity.AspNetIdentity"; } } diff --git a/src/AspNetIdentity/build/build.csproj b/src/AspNetIdentity/build/build.csproj index 43c81aaed..f1804320d 100644 --- a/src/AspNetIdentity/build/build.csproj +++ b/src/AspNetIdentity/build/build.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/src/AspNetIdentity/host/Configuration/Clients.cs b/src/AspNetIdentity/host/Configuration/Clients.cs index ae2c6a1aa..eb652c28e 100644 --- a/src/AspNetIdentity/host/Configuration/Clients.cs +++ b/src/AspNetIdentity/host/Configuration/Clients.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServerHost.Configuration diff --git a/src/AspNetIdentity/host/Configuration/ClientsConsole.cs b/src/AspNetIdentity/host/Configuration/ClientsConsole.cs index 8e5792d85..27c6c0ae6 100644 --- a/src/AspNetIdentity/host/Configuration/ClientsConsole.cs +++ b/src/AspNetIdentity/host/Configuration/ClientsConsole.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Configuration { diff --git a/src/AspNetIdentity/host/Configuration/ClientsWeb.cs b/src/AspNetIdentity/host/Configuration/ClientsWeb.cs index 444b887b4..9909da1a3 100644 --- a/src/AspNetIdentity/host/Configuration/ClientsWeb.cs +++ b/src/AspNetIdentity/host/Configuration/ClientsWeb.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.using System.Collections.Generic; using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Configuration { diff --git a/src/AspNetIdentity/host/Configuration/Resources.cs b/src/AspNetIdentity/host/Configuration/Resources.cs index 12a33bbf4..f73afc04f 100644 --- a/src/AspNetIdentity/host/Configuration/Resources.cs +++ b/src/AspNetIdentity/host/Configuration/Resources.cs @@ -3,9 +3,9 @@ using IdentityModel; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; namespace IdentityServerHost.Configuration { diff --git a/src/AspNetIdentity/host/Data/ApplicationDbContext.cs b/src/AspNetIdentity/host/Data/ApplicationDbContext.cs index a992ea75d..ed2e6ad35 100644 --- a/src/AspNetIdentity/host/Data/ApplicationDbContext.cs +++ b/src/AspNetIdentity/host/Data/ApplicationDbContext.cs @@ -1,4 +1,4 @@ -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; diff --git a/src/AspNetIdentity/host/Host.csproj b/src/AspNetIdentity/host/Host.csproj index 30fcf037f..a4cbd97a2 100644 --- a/src/AspNetIdentity/host/Host.csproj +++ b/src/AspNetIdentity/host/Host.csproj @@ -1,14 +1,11 @@  - netcoreapp3.1 + net10.0 - - - - + diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/ExternalLoginViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/ExternalLoginViewModel.cs index 61ef30754..433744fca 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/ExternalLoginViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/ExternalLoginViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class ExternalLoginViewModel { diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/ForgotPasswordViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/ForgotPasswordViewModel.cs index 25db78ba7..945112474 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/ForgotPasswordViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/ForgotPasswordViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class ForgotPasswordViewModel { diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/LoginViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/LoginViewModel.cs index 6413cd780..ce05c30ab 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/LoginViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/LoginViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class LoginViewModel { diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/LoginWith2faViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/LoginWith2faViewModel.cs index 623f8cb7a..69361e005 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/LoginWith2faViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/LoginWith2faViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class LoginWith2faViewModel { diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/LoginWithRecoveryCodeViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/LoginWithRecoveryCodeViewModel.cs index 76a2a8a04..37747d561 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/LoginWithRecoveryCodeViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/LoginWithRecoveryCodeViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class LoginWithRecoveryCodeViewModel { diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/RegisterViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/RegisterViewModel.cs index 6fa3646ef..f80ffb678 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/RegisterViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/RegisterViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class RegisterViewModel { diff --git a/src/AspNetIdentity/host/Models/AccountViewModels/ResetPasswordViewModel.cs b/src/AspNetIdentity/host/Models/AccountViewModels/ResetPasswordViewModel.cs index f56dcbc73..39ec61597 100644 --- a/src/AspNetIdentity/host/Models/AccountViewModels/ResetPasswordViewModel.cs +++ b/src/AspNetIdentity/host/Models/AccountViewModels/ResetPasswordViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.AccountViewModels +namespace ForgePoint.Identity.Models.AccountViewModels { public class ResetPasswordViewModel { diff --git a/src/AspNetIdentity/host/Models/ApplicationUser.cs b/src/AspNetIdentity/host/Models/ApplicationUser.cs index 3f86aed8d..a8d37c743 100644 --- a/src/AspNetIdentity/host/Models/ApplicationUser.cs +++ b/src/AspNetIdentity/host/Models/ApplicationUser.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Identity; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { // Add profile data for application users by adding properties to the ApplicationUser class public class ApplicationUser : IdentityUser diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/ChangePasswordViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/ChangePasswordViewModel.cs index 6e56e12d3..f352656ac 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/ChangePasswordViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/ChangePasswordViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class ChangePasswordViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/EnableAuthenticatorViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/EnableAuthenticatorViewModel.cs index 103eff7e5..678170763 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/EnableAuthenticatorViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/EnableAuthenticatorViewModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class EnableAuthenticatorViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/ExternalLoginsViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/ExternalLoginsViewModel.cs index 5dfa63c41..473e8dabd 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/ExternalLoginsViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/ExternalLoginsViewModel.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Identity; -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class ExternalLoginsViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/GenerateRecoveryCodesViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/GenerateRecoveryCodesViewModel.cs index 72a0cf09e..306f89fde 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/GenerateRecoveryCodesViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/GenerateRecoveryCodesViewModel.cs @@ -1,4 +1,4 @@ -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class GenerateRecoveryCodesViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/IndexViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/IndexViewModel.cs index 31aab765c..c60227882 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/IndexViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/IndexViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class IndexViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/RemoveLoginViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/RemoveLoginViewModel.cs index c64c6d9bb..894d0a00a 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/RemoveLoginViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/RemoveLoginViewModel.cs @@ -1,4 +1,4 @@ -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class RemoveLoginViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/SetPasswordViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/SetPasswordViewModel.cs index 6a4ea6fd2..4373e4ba4 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/SetPasswordViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/SetPasswordViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class SetPasswordViewModel { diff --git a/src/AspNetIdentity/host/Models/ManageViewModels/TwoFactorAuthenticationViewModel.cs b/src/AspNetIdentity/host/Models/ManageViewModels/TwoFactorAuthenticationViewModel.cs index 2b99cd45b..06cbfe1e0 100644 --- a/src/AspNetIdentity/host/Models/ManageViewModels/TwoFactorAuthenticationViewModel.cs +++ b/src/AspNetIdentity/host/Models/ManageViewModels/TwoFactorAuthenticationViewModel.cs @@ -1,4 +1,4 @@ -namespace IdentityServer4.Models.ManageViewModels +namespace ForgePoint.Identity.Models.ManageViewModels { public class TwoFactorAuthenticationViewModel { diff --git a/src/AspNetIdentity/host/Program.cs b/src/AspNetIdentity/host/Program.cs index 5bb236c5d..1a6e8ba19 100644 --- a/src/AspNetIdentity/host/Program.cs +++ b/src/AspNetIdentity/host/Program.cs @@ -16,7 +16,7 @@ public class Program { public static int Main(string[] args) { - Console.Title = "IdentityServer4.AspNetIdentity"; + Console.Title = "ForgePoint.Identity.AspNetIdentity"; Activity.DefaultIdFormat = ActivityIdFormat.W3C; Log.Logger = new LoggerConfiguration() diff --git a/src/AspNetIdentity/host/Quickstart/Account/AccountController.cs b/src/AspNetIdentity/host/Quickstart/Account/AccountController.cs index d427b051e..893552af8 100644 --- a/src/AspNetIdentity/host/Quickstart/Account/AccountController.cs +++ b/src/AspNetIdentity/host/Quickstart/Account/AccountController.cs @@ -3,12 +3,12 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -217,7 +217,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -319,7 +319,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/src/AspNetIdentity/host/Quickstart/Account/ExternalController.cs b/src/AspNetIdentity/host/Quickstart/Account/ExternalController.cs index 0e66bee4e..d377a41f1 100644 --- a/src/AspNetIdentity/host/Quickstart/Account/ExternalController.cs +++ b/src/AspNetIdentity/host/Quickstart/Account/ExternalController.cs @@ -4,11 +4,11 @@ using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/src/AspNetIdentity/host/Quickstart/Consent/ConsentController.cs b/src/AspNetIdentity/host/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/src/AspNetIdentity/host/Quickstart/Consent/ConsentController.cs +++ b/src/AspNetIdentity/host/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/AspNetIdentity/host/Quickstart/Consent/ProcessConsentResult.cs b/src/AspNetIdentity/host/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/src/AspNetIdentity/host/Quickstart/Consent/ProcessConsentResult.cs +++ b/src/AspNetIdentity/host/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/AspNetIdentity/host/Quickstart/Device/DeviceController.cs b/src/AspNetIdentity/host/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/src/AspNetIdentity/host/Quickstart/Device/DeviceController.cs +++ b/src/AspNetIdentity/host/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/AspNetIdentity/host/Quickstart/Extensions.cs b/src/AspNetIdentity/host/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/src/AspNetIdentity/host/Quickstart/Extensions.cs +++ b/src/AspNetIdentity/host/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/src/AspNetIdentity/host/Quickstart/Grants/GrantsController.cs b/src/AspNetIdentity/host/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/src/AspNetIdentity/host/Quickstart/Grants/GrantsController.cs +++ b/src/AspNetIdentity/host/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/AspNetIdentity/host/Quickstart/Home/ErrorViewModel.cs b/src/AspNetIdentity/host/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/src/AspNetIdentity/host/Quickstart/Home/ErrorViewModel.cs +++ b/src/AspNetIdentity/host/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/AspNetIdentity/host/Quickstart/Home/HomeController.cs b/src/AspNetIdentity/host/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/src/AspNetIdentity/host/Quickstart/Home/HomeController.cs +++ b/src/AspNetIdentity/host/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/src/AspNetIdentity/host/Quickstart/TestUsers.cs b/src/AspNetIdentity/host/Quickstart/TestUsers.cs index b4d2f821f..fa1df9572 100644 --- a/src/AspNetIdentity/host/Quickstart/TestUsers.cs +++ b/src/AspNetIdentity/host/Quickstart/TestUsers.cs @@ -3,7 +3,7 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; @@ -22,7 +22,7 @@ public class TestUsers new Claim(JwtClaimTypes.Email, "AliceSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://alice.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json) } }, new TestUser{SubjectId = "88421113", Username = "bob", Password = "bob", @@ -34,7 +34,7 @@ public class TestUsers new Claim(JwtClaimTypes.Email, "BobSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://bob.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json), new Claim("location", "somewhere") } } diff --git a/src/AspNetIdentity/host/Startup.cs b/src/AspNetIdentity/host/Startup.cs index 09af8eba8..7623eaac2 100644 --- a/src/AspNetIdentity/host/Startup.cs +++ b/src/AspNetIdentity/host/Startup.cs @@ -6,9 +6,9 @@ using Microsoft.Extensions.DependencyInjection; using IdentityServerHost.Data; using IdentityServerHost.Configuration; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Hosting; -using IdentityServer4; +using ForgePoint.Identity; namespace IdentityServerHost { diff --git a/src/AspNetIdentity/host/Views/Home/Index.cshtml b/src/AspNetIdentity/host/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/src/AspNetIdentity/host/Views/Home/Index.cshtml +++ b/src/AspNetIdentity/host/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/src/AspNetIdentity/host/Views/Shared/_Layout.cshtml b/src/AspNetIdentity/host/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/src/AspNetIdentity/host/Views/Shared/_Layout.cshtml +++ b/src/AspNetIdentity/host/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/src/AspNetIdentity/host/Views/Shared/_Nav.cshtml b/src/AspNetIdentity/host/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/src/AspNetIdentity/host/Views/Shared/_Nav.cshtml +++ b/src/AspNetIdentity/host/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/20200323135751_Users.Designer.cs b/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/20200323135751_Users.Designer.cs index ff64f223c..0416cd1ec 100644 --- a/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/20200323135751_Users.Designer.cs +++ b/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/20200323135751_Users.Designer.cs @@ -21,7 +21,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.Models.ApplicationUser", b => + modelBuilder.Entity("ForgePoint.Identity.Models.ApplicationUser", b => { b.Property("Id") .HasColumnType("nvarchar(450)"); @@ -228,7 +228,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -237,7 +237,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -252,7 +252,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -261,7 +261,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) diff --git a/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/ApplicationDbContextModelSnapshot.cs b/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/ApplicationDbContextModelSnapshot.cs index 6da3c414a..4c5d5977f 100644 --- a/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/ApplicationDbContextModelSnapshot.cs +++ b/src/AspNetIdentity/migrations/SqlServer/Migrations/UsersDb/ApplicationDbContextModelSnapshot.cs @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.Models.ApplicationUser", b => + modelBuilder.Entity("ForgePoint.Identity.Models.ApplicationUser", b => { b.Property("Id") .HasColumnType("nvarchar(450)"); @@ -226,7 +226,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -235,7 +235,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -250,7 +250,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -259,7 +259,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("IdentityServer4.Models.ApplicationUser", null) + b.HasOne("ForgePoint.Identity.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) diff --git a/src/AspNetIdentity/migrations/SqlServer/SeedData.cs b/src/AspNetIdentity/migrations/SqlServer/SeedData.cs index 7765bdb92..3381f7c8b 100644 --- a/src/AspNetIdentity/migrations/SqlServer/SeedData.cs +++ b/src/AspNetIdentity/migrations/SqlServer/SeedData.cs @@ -7,7 +7,7 @@ using System.Security.Claims; using IdentityServerHost.Data; using IdentityModel; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -44,7 +44,7 @@ public static void EnsureSeedData(IServiceProvider serviceProvider) new Claim(JwtClaimTypes.Email, "AliceSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://alice.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json) }).Result; if (!result.Succeeded) { @@ -77,7 +77,7 @@ public static void EnsureSeedData(IServiceProvider serviceProvider) new Claim(JwtClaimTypes.Email, "BobSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://bob.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json), new Claim("location", "somewhere") }).Result; if (!result.Succeeded) diff --git a/src/AspNetIdentity/migrations/SqlServer/SqlServer.csproj b/src/AspNetIdentity/migrations/SqlServer/SqlServer.csproj index 2614da8ab..cda55c39b 100644 --- a/src/AspNetIdentity/migrations/SqlServer/SqlServer.csproj +++ b/src/AspNetIdentity/migrations/SqlServer/SqlServer.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/src/AspNetIdentity/migrations/SqlServer/Startup.cs b/src/AspNetIdentity/migrations/SqlServer/Startup.cs index 8bdf5ed4f..1c41fb756 100644 --- a/src/AspNetIdentity/migrations/SqlServer/Startup.cs +++ b/src/AspNetIdentity/migrations/SqlServer/Startup.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using IdentityServerHost.Data; using Microsoft.AspNetCore.Identity; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace SqlServer { diff --git a/src/AspNetIdentity/src/Decorator.cs b/src/AspNetIdentity/src/Decorator.cs index 2bd2120d0..d35d62d87 100644 --- a/src/AspNetIdentity/src/Decorator.cs +++ b/src/AspNetIdentity/src/Decorator.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.AspNetIdentity +namespace ForgePoint.Identity.AspNetIdentity { internal class Decorator { diff --git a/src/AspNetIdentity/src/IdentityServer4.AspNetIdentity.csproj b/src/AspNetIdentity/src/IdentityServer4.AspNetIdentity.csproj index fd77a9705..590db689c 100644 --- a/src/AspNetIdentity/src/IdentityServer4.AspNetIdentity.csproj +++ b/src/AspNetIdentity/src/IdentityServer4.AspNetIdentity.csproj @@ -1,17 +1,15 @@  - IdentityServer4.AspNetIdentity - netcoreapp3.1 + ForgePoint.Identity.AspNetIdentity + net8.0;net10.0 - ASP.NET Core Identity Integration for IdentityServer4 - Brock Allen;Dominick Baier - IdentityServer4.AspNetIdentity - OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;IdentityServer;ASP.NET Identity + ASP.NET Core Identity integration for ForgePoint.Identity + ForgePoint.Identity.AspNetIdentity + ForgePoint.Identity.AspNetIdentity + OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;ForgePoint;IdentityServer4;ASP.NET Identity icon.jpg - https://github.com/IdentityServer/IdentityServer4 Apache-2.0 - https://github.com/IdentityServer/IdentityServer4/releases true true @@ -39,7 +37,7 @@ - + diff --git a/src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs b/src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs index 7eaa91355..81033ccf0 100644 --- a/src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs +++ b/src/AspNetIdentity/src/IdentityServerBuilderExtensions.cs @@ -5,9 +5,9 @@ using System; using System.Linq; using IdentityModel; -using IdentityServer4; -using IdentityServer4.AspNetIdentity; -using IdentityServer4.Configuration; +using ForgePoint.Identity; +using ForgePoint.Identity.AspNetIdentity; +using ForgePoint.Identity.Configuration; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Identity; diff --git a/src/AspNetIdentity/src/ProfileService.cs b/src/AspNetIdentity/src/ProfileService.cs index 3460b2853..115efacfc 100644 --- a/src/AspNetIdentity/src/ProfileService.cs +++ b/src/AspNetIdentity/src/ProfileService.cs @@ -2,22 +2,22 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Logging; using System; using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.AspNetIdentity +namespace ForgePoint.Identity.AspNetIdentity { /// /// IProfileService to integrate with ASP.NET Identity. /// /// The type of the user. - /// + /// public class ProfileService : IProfileService where TUser : class { diff --git a/src/AspNetIdentity/src/ResourceOwnerPasswordValidator.cs b/src/AspNetIdentity/src/ResourceOwnerPasswordValidator.cs index 81a2feac3..c3ba47377 100644 --- a/src/AspNetIdentity/src/ResourceOwnerPasswordValidator.cs +++ b/src/AspNetIdentity/src/ResourceOwnerPasswordValidator.cs @@ -2,22 +2,22 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Logging; using System.Threading.Tasks; using static IdentityModel.OidcConstants; -using IdentityServer4.Services; -using IdentityServer4.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Events; -namespace IdentityServer4.AspNetIdentity +namespace ForgePoint.Identity.AspNetIdentity { /// /// IResourceOwnerPasswordValidator that integrates with ASP.NET Identity. /// /// The type of the user. - /// + /// public class ResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator where TUser : class { diff --git a/src/AspNetIdentity/src/SecurityStampValidatorCallback.cs b/src/AspNetIdentity/src/SecurityStampValidatorCallback.cs index f07ebb0c4..6b433b529 100644 --- a/src/AspNetIdentity/src/SecurityStampValidatorCallback.cs +++ b/src/AspNetIdentity/src/SecurityStampValidatorCallback.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using System.Linq; -namespace IdentityServer4.AspNetIdentity +namespace ForgePoint.Identity.AspNetIdentity { /// /// Implements callback for SecurityStampValidator's OnRefreshingPrincipal event. diff --git a/src/AspNetIdentity/src/UserClaimsFactory.cs b/src/AspNetIdentity/src/UserClaimsFactory.cs index 3dc69c7df..b9d622436 100644 --- a/src/AspNetIdentity/src/UserClaimsFactory.cs +++ b/src/AspNetIdentity/src/UserClaimsFactory.cs @@ -9,7 +9,7 @@ using System.Security.Claims; using IdentityModel; -namespace IdentityServer4.AspNetIdentity +namespace ForgePoint.Identity.AspNetIdentity { internal class UserClaimsFactory : IUserClaimsPrincipalFactory where TUser : class diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 292310cb4..9a2746a9a 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,57 +1,69 @@ - 3.1.0 - 3.1.0 - 3.1.0 - - 4.1.2-* + 10.0 + + + ForgePoint Labs + ForgePoint.Identity + ForgePoint Labs + https://github.com/joneja09/IdentityServer4 + https://github.com/joneja09/IdentityServer4/releases + + 10.0.0-* + + 8.0.21 + 10.0.11 + 10.0.11 + + 8.0.21 + 10.0.11 + 10.0.11 - + - + - - - - + + + + - + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + - - - - - - + + + + + + @@ -67,4 +79,4 @@ $(MinVerMajor).$(MinVerMinor).$(MinVerPatch).0 - \ No newline at end of file + diff --git a/src/EntityFramework.Storage/README.md b/src/EntityFramework.Storage/README.md index e9d2088c4..b6507f3fd 100644 --- a/src/EntityFramework.Storage/README.md +++ b/src/EntityFramework.Storage/README.md @@ -1,7 +1,7 @@ -# IdentityServer4.EntityFramework.Storage +# ForgePoint.Identity.EntityFramework.Storage -IdentityServer4.EntityFramework.Storage is a persistence layer for IdentityServer 4 configuration data that uses EntityFramework as its database abstraction. +ForgePoint.Identity.EntityFramework.Storage is the Entity Framework Core persistence layer for ForgePoint.Identity configuration and operational data. Namespaces are `ForgePoint.Identity.EntityFramework.*`. ## Issues -For issues, use the [consolidated IdentityServer4 issue tracker](https://github.com/IdentityServer/IdentityServer4/issues). +Open issues on this repository. diff --git a/src/EntityFramework.Storage/build/Program.cs b/src/EntityFramework.Storage/build/Program.cs index 2900cf309..fa66d252f 100644 --- a/src/EntityFramework.Storage/build/Program.cs +++ b/src/EntityFramework.Storage/build/Program.cs @@ -2,6 +2,6 @@ { partial class Program { - private const string Prefix = "EntityFramework.Storage"; + private const string Prefix = "ForgePoint.Identity.EntityFramework.Storage"; } } diff --git a/src/EntityFramework.Storage/build/build.csproj b/src/EntityFramework.Storage/build/build.csproj index 43c81aaed..f1804320d 100644 --- a/src/EntityFramework.Storage/build/build.csproj +++ b/src/EntityFramework.Storage/build/build.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/src/EntityFramework.Storage/host/ConsoleHost/ConsoleHost.csproj b/src/EntityFramework.Storage/host/ConsoleHost/ConsoleHost.csproj index 9906d5330..bc41d63fe 100644 --- a/src/EntityFramework.Storage/host/ConsoleHost/ConsoleHost.csproj +++ b/src/EntityFramework.Storage/host/ConsoleHost/ConsoleHost.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/src/EntityFramework.Storage/host/ConsoleHost/Program.cs b/src/EntityFramework.Storage/host/ConsoleHost/Program.cs index 1a57e4d5d..91f4abb8e 100644 --- a/src/EntityFramework.Storage/host/ConsoleHost/Program.cs +++ b/src/EntityFramework.Storage/host/ConsoleHost/Program.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System; -using IdentityServer4.EntityFramework.Storage; +using ForgePoint.Identity.EntityFramework.Storage; using Microsoft.EntityFrameworkCore; -using IdentityServer4.EntityFramework; +using ForgePoint.Identity.EntityFramework; namespace ConsoleHost { @@ -11,7 +11,7 @@ class Program { static void Main(string[] args) { - var connectionString = "server=(localdb)\\mssqllocaldb;database=IdentityServer4.EntityFramework-4.0.0;trusted_connection=yes;"; + var connectionString = "server=(localdb)\\mssqllocaldb;database=ForgePoint.Identity.EntityFramework-4.0.0;trusted_connection=yes;"; var services = new ServiceCollection(); services.AddLogging(b => b.AddConsole().SetMinimumLevel(LogLevel.Trace)); diff --git a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20200522172542_Config.Designer.cs b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20200522172542_Config.Designer.cs index 4b3d817e6..b42d1c318 100644 --- a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20200522172542_Config.Designer.cs +++ b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20200522172542_Config.Designer.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -21,7 +21,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -71,7 +71,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -93,7 +93,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -120,7 +120,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -142,7 +142,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -179,7 +179,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -219,7 +219,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -241,7 +241,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -268,7 +268,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -426,7 +426,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("Clients"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -453,7 +453,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -475,7 +475,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientCorsOrigins"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -497,7 +497,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientGrantTypes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -519,7 +519,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientIdPRestrictions"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -541,7 +541,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientPostLogoutRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -568,7 +568,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -590,7 +590,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -612,7 +612,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -649,7 +649,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -698,7 +698,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -720,7 +720,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -747,153 +747,153 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("Properties") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) diff --git a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20260826120000_AddRequirePushedAuthorization.cs b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20260826120000_AddRequirePushedAuthorization.cs new file mode 100644 index 000000000..e03f0ea89 --- /dev/null +++ b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/20260826120000_AddRequirePushedAuthorization.cs @@ -0,0 +1,25 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SqlServer.Migrations.ConfigurationDb +{ + public partial class AddRequirePushedAuthorization : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "RequirePushedAuthorization", + table: "Clients", + type: "bit", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "RequirePushedAuthorization", + table: "Clients"); + } + } +} diff --git a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs index 1c72a580b..4ea9e8ee7 100644 --- a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs +++ b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -69,7 +69,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -91,7 +91,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -118,7 +118,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -140,7 +140,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -177,7 +177,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiResourceSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -217,7 +217,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -239,7 +239,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -266,7 +266,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ApiScopeProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -400,6 +400,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("RequireRequestObject") .HasColumnType("bit"); + b.Property("RequirePushedAuthorization") + .HasColumnType("bit"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); @@ -424,7 +427,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Clients"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -451,7 +454,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -473,7 +476,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientCorsOrigins"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -495,7 +498,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientGrantTypes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -517,7 +520,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientIdPRestrictions"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -539,7 +542,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientPostLogoutRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -566,7 +569,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -588,7 +591,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientRedirectUris"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -610,7 +613,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientScopes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -647,7 +650,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -696,7 +699,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -718,7 +721,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -745,153 +748,153 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiResourceSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.ApiScope", "Scope") .WithMany("Properties") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientCorsOrigin", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientGrantType", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientIdPRestriction", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientRedirectUri", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientScope", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.ClientSecret", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.IdentityResourceProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + b.HasOne("ForgePoint.Identity.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) diff --git a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/20200522172538_Grants.Designer.cs b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/20200522172538_Grants.Designer.cs index 56449c342..10b454dbb 100644 --- a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/20200522172538_Grants.Designer.cs +++ b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/20200522172538_Grants.Designer.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -21,7 +21,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("nvarchar(200)") @@ -71,7 +71,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("DeviceCodes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("nvarchar(200)") diff --git a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs index 0088930d0..d97c6d3f0 100644 --- a/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs +++ b/src/EntityFramework.Storage/migrations/SqlServer/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("nvarchar(200)") @@ -69,7 +69,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("DeviceCodes"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + modelBuilder.Entity("ForgePoint.Identity.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("nvarchar(200)") diff --git a/src/EntityFramework.Storage/migrations/SqlServer/SqlServer.csproj b/src/EntityFramework.Storage/migrations/SqlServer/SqlServer.csproj index 5307d2fb9..f82ba5585 100644 --- a/src/EntityFramework.Storage/migrations/SqlServer/SqlServer.csproj +++ b/src/EntityFramework.Storage/migrations/SqlServer/SqlServer.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/src/EntityFramework.Storage/migrations/SqlServer/Startup.cs b/src/EntityFramework.Storage/migrations/SqlServer/Startup.cs index a3eb7b03e..bf25492d0 100644 --- a/src/EntityFramework.Storage/migrations/SqlServer/Startup.cs +++ b/src/EntityFramework.Storage/migrations/SqlServer/Startup.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Configuration; -using IdentityServer4.EntityFramework.Storage; +using ForgePoint.Identity.EntityFramework.Storage; using Microsoft.EntityFrameworkCore; namespace SqlServer diff --git a/src/EntityFramework.Storage/src/Configuration/ServiceCollectionExtensions.cs b/src/EntityFramework.Storage/src/Configuration/ServiceCollectionExtensions.cs index 6cded2dc7..037185c23 100644 --- a/src/EntityFramework.Storage/src/Configuration/ServiceCollectionExtensions.cs +++ b/src/EntityFramework.Storage/src/Configuration/ServiceCollectionExtensions.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Interfaces; using System; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Options; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -namespace IdentityServer4.EntityFramework.Storage +namespace ForgePoint.Identity.EntityFramework.Storage { /// /// Extension methods to add EF database support to IdentityServer. diff --git a/src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs b/src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs index 5b8620414..b6defa547 100644 --- a/src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs +++ b/src/EntityFramework.Storage/src/DbContexts/ConfigurationDbContext.cs @@ -3,19 +3,19 @@ using System; -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Extensions; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Extensions; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Options; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.DbContexts +namespace ForgePoint.Identity.EntityFramework.DbContexts { /// /// DbContext for the IdentityServer configuration data. /// /// - /// + /// public class ConfigurationDbContext : ConfigurationDbContext { /// @@ -34,7 +34,7 @@ public ConfigurationDbContext(DbContextOptions options, /// DbContext for the IdentityServer configuration data. /// /// - /// + /// public class ConfigurationDbContext : DbContext, IConfigurationDbContext where TContext : DbContext, IConfigurationDbContext { diff --git a/src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs b/src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs index ccb1e477a..f6261bb0b 100644 --- a/src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs +++ b/src/EntityFramework.Storage/src/DbContexts/PersistedGrantDbContext.cs @@ -4,19 +4,19 @@ using System; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Extensions; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Extensions; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Options; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.DbContexts +namespace ForgePoint.Identity.EntityFramework.DbContexts { /// /// DbContext for the IdentityServer operational data. /// /// - /// + /// public class PersistedGrantDbContext : PersistedGrantDbContext { /// @@ -35,7 +35,7 @@ public PersistedGrantDbContext(DbContextOptions options /// DbContext for the IdentityServer operational data. /// /// - /// + /// public class PersistedGrantDbContext : DbContext, IPersistedGrantDbContext where TContext : DbContext, IPersistedGrantDbContext { diff --git a/src/EntityFramework.Storage/src/Entities/ApiResource.cs b/src/EntityFramework.Storage/src/Entities/ApiResource.cs index 4b77349ff..89fa4bc78 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiResource.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiResource.cs @@ -6,7 +6,7 @@ using System; using System.Collections.Generic; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiResource { diff --git a/src/EntityFramework.Storage/src/Entities/ApiResourceClaim.cs b/src/EntityFramework.Storage/src/Entities/ApiResourceClaim.cs index 7550144a0..f4b71f7af 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiResourceClaim.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiResourceClaim.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiResourceClaim : UserClaim { diff --git a/src/EntityFramework.Storage/src/Entities/ApiResourceProperty.cs b/src/EntityFramework.Storage/src/Entities/ApiResourceProperty.cs index 4c6633190..d1eaf7958 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiResourceProperty.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiResourceProperty.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiResourceProperty : Property { diff --git a/src/EntityFramework.Storage/src/Entities/ApiResourceScope.cs b/src/EntityFramework.Storage/src/Entities/ApiResourceScope.cs index 211626bc9..c4c5e132d 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiResourceScope.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiResourceScope.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiResourceScope { diff --git a/src/EntityFramework.Storage/src/Entities/ApiResourceSecret.cs b/src/EntityFramework.Storage/src/Entities/ApiResourceSecret.cs index 04b6af43d..b2d6d5d41 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiResourceSecret.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiResourceSecret.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiResourceSecret : Secret { diff --git a/src/EntityFramework.Storage/src/Entities/ApiScope.cs b/src/EntityFramework.Storage/src/Entities/ApiScope.cs index 8fe96a630..dc327bae9 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiScope.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiScope.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiScope { diff --git a/src/EntityFramework.Storage/src/Entities/ApiScopeClaim.cs b/src/EntityFramework.Storage/src/Entities/ApiScopeClaim.cs index 52a720c6d..2e72ad247 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiScopeClaim.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiScopeClaim.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiScopeClaim : UserClaim { diff --git a/src/EntityFramework.Storage/src/Entities/ApiScopeProperty.cs b/src/EntityFramework.Storage/src/Entities/ApiScopeProperty.cs index 1b0daec3b..e2895f7d4 100644 --- a/src/EntityFramework.Storage/src/Entities/ApiScopeProperty.cs +++ b/src/EntityFramework.Storage/src/Entities/ApiScopeProperty.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ApiScopeProperty : Property { diff --git a/src/EntityFramework.Storage/src/Entities/Client.cs b/src/EntityFramework.Storage/src/Entities/Client.cs index d23079c33..4a8e823ba 100644 --- a/src/EntityFramework.Storage/src/Entities/Client.cs +++ b/src/EntityFramework.Storage/src/Entities/Client.cs @@ -4,11 +4,11 @@ #pragma warning disable 1591 -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System; using System.Collections.Generic; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class Client { @@ -29,6 +29,7 @@ public class Client public bool RequirePkce { get; set; } = true; public bool AllowPlainTextPkce { get; set; } public bool RequireRequestObject { get; set; } + public bool RequirePushedAuthorization { get; set; } public bool AllowAccessTokensViaBrowser { get; set; } public List RedirectUris { get; set; } public List PostLogoutRedirectUris { get; set; } diff --git a/src/EntityFramework.Storage/src/Entities/ClientClaim.cs b/src/EntityFramework.Storage/src/Entities/ClientClaim.cs index 19db04dbe..65f571c26 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientClaim.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientClaim.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientClaim { diff --git a/src/EntityFramework.Storage/src/Entities/ClientCorsOrigin.cs b/src/EntityFramework.Storage/src/Entities/ClientCorsOrigin.cs index 7c2500705..e019dfed5 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientCorsOrigin.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientCorsOrigin.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientCorsOrigin { diff --git a/src/EntityFramework.Storage/src/Entities/ClientGrantType.cs b/src/EntityFramework.Storage/src/Entities/ClientGrantType.cs index b6ba56d42..083ad4ef5 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientGrantType.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientGrantType.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientGrantType { diff --git a/src/EntityFramework.Storage/src/Entities/ClientIdPRestriction.cs b/src/EntityFramework.Storage/src/Entities/ClientIdPRestriction.cs index 7a3fdc059..3cf26daec 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientIdPRestriction.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientIdPRestriction.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientIdPRestriction { diff --git a/src/EntityFramework.Storage/src/Entities/ClientPostLogoutRedirectUri.cs b/src/EntityFramework.Storage/src/Entities/ClientPostLogoutRedirectUri.cs index 84cf730fc..9eada16e0 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientPostLogoutRedirectUri.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientPostLogoutRedirectUri.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientPostLogoutRedirectUri { diff --git a/src/EntityFramework.Storage/src/Entities/ClientProperty.cs b/src/EntityFramework.Storage/src/Entities/ClientProperty.cs index 54599525b..caa09d47f 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientProperty.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientProperty.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientProperty : Property { diff --git a/src/EntityFramework.Storage/src/Entities/ClientRedirectUri.cs b/src/EntityFramework.Storage/src/Entities/ClientRedirectUri.cs index f33660a58..b6295c39e 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientRedirectUri.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientRedirectUri.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientRedirectUri { diff --git a/src/EntityFramework.Storage/src/Entities/ClientScope.cs b/src/EntityFramework.Storage/src/Entities/ClientScope.cs index 7bb76cc2c..9b53c9db5 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientScope.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientScope.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientScope { diff --git a/src/EntityFramework.Storage/src/Entities/ClientSecret.cs b/src/EntityFramework.Storage/src/Entities/ClientSecret.cs index e6e6f2be2..6c7b19f5d 100644 --- a/src/EntityFramework.Storage/src/Entities/ClientSecret.cs +++ b/src/EntityFramework.Storage/src/Entities/ClientSecret.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class ClientSecret : Secret { diff --git a/src/EntityFramework.Storage/src/Entities/DeviceFlowCodes.cs b/src/EntityFramework.Storage/src/Entities/DeviceFlowCodes.cs index 07efb4600..741840903 100644 --- a/src/EntityFramework.Storage/src/Entities/DeviceFlowCodes.cs +++ b/src/EntityFramework.Storage/src/Entities/DeviceFlowCodes.cs @@ -1,6 +1,6 @@ using System; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { /// /// Entity for device flow codes diff --git a/src/EntityFramework.Storage/src/Entities/IdentityResource.cs b/src/EntityFramework.Storage/src/Entities/IdentityResource.cs index 11ee22b12..bb0f8ca5b 100644 --- a/src/EntityFramework.Storage/src/Entities/IdentityResource.cs +++ b/src/EntityFramework.Storage/src/Entities/IdentityResource.cs @@ -7,7 +7,7 @@ using System; using System.Collections.Generic; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class IdentityResource { diff --git a/src/EntityFramework.Storage/src/Entities/IdentityResourceClaim.cs b/src/EntityFramework.Storage/src/Entities/IdentityResourceClaim.cs index ae381ae44..70513b960 100644 --- a/src/EntityFramework.Storage/src/Entities/IdentityResourceClaim.cs +++ b/src/EntityFramework.Storage/src/Entities/IdentityResourceClaim.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class IdentityResourceClaim : UserClaim { diff --git a/src/EntityFramework.Storage/src/Entities/IdentityResourceProperty.cs b/src/EntityFramework.Storage/src/Entities/IdentityResourceProperty.cs index 1af593f08..19cfcf7b3 100644 --- a/src/EntityFramework.Storage/src/Entities/IdentityResourceProperty.cs +++ b/src/EntityFramework.Storage/src/Entities/IdentityResourceProperty.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class IdentityResourceProperty : Property { diff --git a/src/EntityFramework.Storage/src/Entities/PersistedGrant.cs b/src/EntityFramework.Storage/src/Entities/PersistedGrant.cs index ce5312920..02d3701f9 100644 --- a/src/EntityFramework.Storage/src/Entities/PersistedGrant.cs +++ b/src/EntityFramework.Storage/src/Entities/PersistedGrant.cs @@ -6,7 +6,7 @@ using System; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public class PersistedGrant { diff --git a/src/EntityFramework.Storage/src/Entities/Property.cs b/src/EntityFramework.Storage/src/Entities/Property.cs index d2f1a45aa..0a5f06860 100644 --- a/src/EntityFramework.Storage/src/Entities/Property.cs +++ b/src/EntityFramework.Storage/src/Entities/Property.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public abstract class Property { diff --git a/src/EntityFramework.Storage/src/Entities/Secret.cs b/src/EntityFramework.Storage/src/Entities/Secret.cs index 86a9e5285..7bd31a157 100644 --- a/src/EntityFramework.Storage/src/Entities/Secret.cs +++ b/src/EntityFramework.Storage/src/Entities/Secret.cs @@ -6,7 +6,7 @@ using System; -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public abstract class Secret { diff --git a/src/EntityFramework.Storage/src/Entities/UserClaim.cs b/src/EntityFramework.Storage/src/Entities/UserClaim.cs index 4755ac250..c741e2bcd 100644 --- a/src/EntityFramework.Storage/src/Entities/UserClaim.cs +++ b/src/EntityFramework.Storage/src/Entities/UserClaim.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.EntityFramework.Entities +namespace ForgePoint.Identity.EntityFramework.Entities { public abstract class UserClaim { diff --git a/src/EntityFramework.Storage/src/Extensions/ModelBuilderExtensions.cs b/src/EntityFramework.Storage/src/Extensions/ModelBuilderExtensions.cs index 6f77c7245..dbbe45467 100644 --- a/src/EntityFramework.Storage/src/Extensions/ModelBuilderExtensions.cs +++ b/src/EntityFramework.Storage/src/Extensions/ModelBuilderExtensions.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Options; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace IdentityServer4.EntityFramework.Extensions +namespace ForgePoint.Identity.EntityFramework.Extensions { /// /// Extension methods to define the database schema for the configuration and operational data stores. diff --git a/src/EntityFramework.Storage/src/IdentityServer4.EntityFramework.Storage.csproj b/src/EntityFramework.Storage/src/IdentityServer4.EntityFramework.Storage.csproj index cd8a6c576..fdbaf7f65 100644 --- a/src/EntityFramework.Storage/src/IdentityServer4.EntityFramework.Storage.csproj +++ b/src/EntityFramework.Storage/src/IdentityServer4.EntityFramework.Storage.csproj @@ -1,16 +1,15 @@  - IdentityServer4.EntityFramework.Storage - netstandard2.0 + ForgePoint.Identity.EntityFramework.Storage + net8.0;net10.0 - EntityFramework persistence layer for IdentityServer4 - Brock Allen;Dominick Baier;Scott Brady - OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;IdentityServer;EntityFramework + EntityFramework persistence layer for ForgePoint.Identity + ForgePoint.Identity.EntityFramework.Storage + ForgePoint.Identity.EntityFramework + OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;ForgePoint;IdentityServer4;EntityFramework icon.jpg - https://github.com/IdentityServer/IdentityServer4 Apache-2.0 - https://github.com/IdentityServer/IdentityServer4/releases true true @@ -32,9 +31,7 @@ - - - + diff --git a/src/EntityFramework.Storage/src/Interfaces/IConfigurationDbContext.cs b/src/EntityFramework.Storage/src/Interfaces/IConfigurationDbContext.cs index 81d075f7e..0d5a3886b 100644 --- a/src/EntityFramework.Storage/src/Interfaces/IConfigurationDbContext.cs +++ b/src/EntityFramework.Storage/src/Interfaces/IConfigurationDbContext.cs @@ -3,10 +3,10 @@ using System; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.Interfaces +namespace ForgePoint.Identity.EntityFramework.Interfaces { /// /// Abstraction for the configuration context. diff --git a/src/EntityFramework.Storage/src/Interfaces/IPersistedGrantDbContext.cs b/src/EntityFramework.Storage/src/Interfaces/IPersistedGrantDbContext.cs index 2a4f1b59d..65b2251e7 100644 --- a/src/EntityFramework.Storage/src/Interfaces/IPersistedGrantDbContext.cs +++ b/src/EntityFramework.Storage/src/Interfaces/IPersistedGrantDbContext.cs @@ -4,10 +4,10 @@ using System; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.Interfaces +namespace ForgePoint.Identity.EntityFramework.Interfaces { /// /// Abstraction for the operational data context. diff --git a/src/EntityFramework.Storage/src/Mappers/AllowedSigningAlgorithmsConverter.cs b/src/EntityFramework.Storage/src/Mappers/AllowedSigningAlgorithmsConverter.cs index bdc8eff9f..f6224bd34 100644 --- a/src/EntityFramework.Storage/src/Mappers/AllowedSigningAlgorithmsConverter.cs +++ b/src/EntityFramework.Storage/src/Mappers/AllowedSigningAlgorithmsConverter.cs @@ -5,26 +5,22 @@ using System; using System.Collections.Generic; using System.Linq; -using AutoMapper; -namespace IdentityServer4.EntityFramework.Mappers +namespace ForgePoint.Identity.EntityFramework.Mappers { - class AllowedSigningAlgorithmsConverter : - IValueConverter, string>, - IValueConverter> + internal static class AllowedSigningAlgorithmsConverter { - public static AllowedSigningAlgorithmsConverter Converter = new AllowedSigningAlgorithmsConverter(); - - public string Convert(ICollection sourceMember, ResolutionContext context) + public static string Convert(ICollection sourceMember) { if (sourceMember == null || !sourceMember.Any()) { return null; } + return sourceMember.Aggregate((x, y) => $"{x},{y}"); } - public ICollection Convert(string sourceMember, ResolutionContext context) + public static ICollection Convert(string sourceMember) { var list = new HashSet(); if (!String.IsNullOrWhiteSpace(sourceMember)) diff --git a/src/EntityFramework.Storage/src/Mappers/ApiResourceMapperProfile.cs b/src/EntityFramework.Storage/src/Mappers/ApiResourceMapperProfile.cs deleted file mode 100644 index 96a8d110c..000000000 --- a/src/EntityFramework.Storage/src/Mappers/ApiResourceMapperProfile.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using System.Collections.Generic; -using AutoMapper; - -namespace IdentityServer4.EntityFramework.Mappers -{ - /// - /// Defines entity/model mapping for API resources. - /// - /// - public class ApiResourceMapperProfile : Profile - { - /// - /// - /// - public ApiResourceMapperProfile() - { - CreateMap>() - .ReverseMap(); - - CreateMap(MemberList.Destination) - .ConstructUsing(src => new Models.ApiResource()) - .ForMember(x => x.ApiSecrets, opts => opts.MapFrom(x => x.Secrets)) - .ForMember(x=>x.AllowedAccessTokenSigningAlgorithms, opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, x=>x.AllowedAccessTokenSigningAlgorithms)) - .ReverseMap() - .ForMember(x => x.AllowedAccessTokenSigningAlgorithms, opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, x => x.AllowedAccessTokenSigningAlgorithms)); - - CreateMap() - .ConstructUsing(x => x.Type) - .ReverseMap() - .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src)); - - CreateMap(MemberList.Destination) - .ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null)) - .ReverseMap(); - - CreateMap() - .ConstructUsing(x => x.Scope) - .ReverseMap() - .ForMember(dest => dest.Scope, opt => opt.MapFrom(src => src)); - } - } -} diff --git a/src/EntityFramework.Storage/src/Mappers/ApiResourceMappers.cs b/src/EntityFramework.Storage/src/Mappers/ApiResourceMappers.cs index 0501a5f3d..fbcb105ca 100644 --- a/src/EntityFramework.Storage/src/Mappers/ApiResourceMappers.cs +++ b/src/EntityFramework.Storage/src/Mappers/ApiResourceMappers.cs @@ -2,24 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using AutoMapper; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; -namespace IdentityServer4.EntityFramework.Mappers +namespace ForgePoint.Identity.EntityFramework.Mappers { /// /// Extension methods to map to/from entity/model for API resources. /// public static class ApiResourceMappers { - static ApiResourceMappers() - { - Mapper = new MapperConfiguration(cfg => cfg.AddProfile()) - .CreateMapper(); - } - - internal static IMapper Mapper { get; } - /// /// Maps an entity to a model. /// @@ -27,7 +18,24 @@ static ApiResourceMappers() /// public static Models.ApiResource ToModel(this ApiResource entity) { - return entity == null ? null : Mapper.Map(entity); + if (entity == null) + { + return null; + } + + return new Models.ApiResource + { + Enabled = entity.Enabled, + Name = entity.Name, + DisplayName = entity.DisplayName, + Description = entity.Description, + ShowInDiscoveryDocument = entity.ShowInDiscoveryDocument, + AllowedAccessTokenSigningAlgorithms = AllowedSigningAlgorithmsConverter.Convert(entity.AllowedAccessTokenSigningAlgorithms), + ApiSecrets = MappingHelpers.MapList(entity.Secrets, MappingHelpers.ToSecret), + Scopes = MappingHelpers.MapStrings(entity.Scopes, x => x.Scope), + UserClaims = MappingHelpers.MapStrings(entity.UserClaims, x => x.Type), + Properties = MappingHelpers.MapProperties(entity.Properties) + }; } /// @@ -37,7 +45,24 @@ public static Models.ApiResource ToModel(this ApiResource entity) /// public static ApiResource ToEntity(this Models.ApiResource model) { - return model == null ? null : Mapper.Map(model); + if (model == null) + { + return null; + } + + return new ApiResource + { + Enabled = model.Enabled, + Name = model.Name, + DisplayName = model.DisplayName, + Description = model.Description, + ShowInDiscoveryDocument = model.ShowInDiscoveryDocument, + AllowedAccessTokenSigningAlgorithms = AllowedSigningAlgorithmsConverter.Convert(model.AllowedAccessTokenSigningAlgorithms), + Secrets = MappingHelpers.MapList(model.ApiSecrets, MappingHelpers.ToEntitySecret), + Scopes = MappingHelpers.MapList(model.Scopes, x => new ApiResourceScope { Scope = x }), + UserClaims = MappingHelpers.MapList(model.UserClaims, x => new ApiResourceClaim { Type = x }), + Properties = MappingHelpers.MapProperties(model.Properties) + }; } } -} \ No newline at end of file +} diff --git a/src/EntityFramework.Storage/src/Mappers/ClientMapperProfile.cs b/src/EntityFramework.Storage/src/Mappers/ClientMapperProfile.cs deleted file mode 100644 index 6e5304687..000000000 --- a/src/EntityFramework.Storage/src/Mappers/ClientMapperProfile.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using System.Collections.Generic; -using System.Security.Claims; -using AutoMapper; -using IdentityServer4.Models; - -namespace IdentityServer4.EntityFramework.Mappers -{ - /// - /// Defines entity/model mapping for clients. - /// - /// - public class ClientMapperProfile : Profile - { - /// - /// - /// {ClientMapperProfile} - /// - /// - public ClientMapperProfile() - { - CreateMap>() - .ReverseMap(); - - CreateMap() - .ForMember(dest => dest.ProtocolType, opt => opt.Condition(srs => srs != null)) - .ForMember(x => x.AllowedIdentityTokenSigningAlgorithms, opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, x => x.AllowedIdentityTokenSigningAlgorithms)) - .ReverseMap() - .ForMember(x => x.AllowedIdentityTokenSigningAlgorithms, opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, x => x.AllowedIdentityTokenSigningAlgorithms)); - - CreateMap() - .ConstructUsing(src => src.Origin) - .ReverseMap() - .ForMember(dest => dest.Origin, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.Provider) - .ReverseMap() - .ForMember(dest => dest.Provider, opt => opt.MapFrom(src => src)); - - CreateMap(MemberList.None) - .ConstructUsing(src => new ClientClaim(src.Type, src.Value, ClaimValueTypes.String)) - .ReverseMap(); - - CreateMap() - .ConstructUsing(src => src.Scope) - .ReverseMap() - .ForMember(dest => dest.Scope, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.PostLogoutRedirectUri) - .ReverseMap() - .ForMember(dest => dest.PostLogoutRedirectUri, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.RedirectUri) - .ReverseMap() - .ForMember(dest => dest.RedirectUri, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.GrantType) - .ReverseMap() - .ForMember(dest => dest.GrantType, opt => opt.MapFrom(src => src)); - - CreateMap(MemberList.Destination) - .ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null)) - .ReverseMap(); - } - } -} \ No newline at end of file diff --git a/src/EntityFramework.Storage/src/Mappers/ClientMappers.cs b/src/EntityFramework.Storage/src/Mappers/ClientMappers.cs index c12b3bda4..90551b483 100644 --- a/src/EntityFramework.Storage/src/Mappers/ClientMappers.cs +++ b/src/EntityFramework.Storage/src/Mappers/ClientMappers.cs @@ -2,23 +2,18 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using AutoMapper; +using System; +using System.Linq; +using System.Security.Claims; +using ForgePoint.Identity.Models; -namespace IdentityServer4.EntityFramework.Mappers +namespace ForgePoint.Identity.EntityFramework.Mappers { /// /// Extension methods to map to/from entity/model for clients. /// public static class ClientMappers { - static ClientMappers() - { - Mapper = new MapperConfiguration(cfg => cfg.AddProfile()) - .CreateMapper(); - } - - internal static IMapper Mapper { get; } - /// /// Maps an entity to a model. /// @@ -26,7 +21,71 @@ static ClientMappers() /// public static Models.Client ToModel(this Entities.Client entity) { - return Mapper.Map(entity); + if (entity == null) + { + return null; + } + + var model = new Models.Client + { + Enabled = entity.Enabled, + ClientId = entity.ClientId, + RequireClientSecret = entity.RequireClientSecret, + ClientName = entity.ClientName, + Description = entity.Description, + ClientUri = entity.ClientUri, + LogoUri = entity.LogoUri, + RequireConsent = entity.RequireConsent, + AllowRememberConsent = entity.AllowRememberConsent, + AlwaysIncludeUserClaimsInIdToken = entity.AlwaysIncludeUserClaimsInIdToken, + AllowedGrantTypes = entity.AllowedGrantTypes == null + ? Array.Empty() + : entity.AllowedGrantTypes.Select(x => x.GrantType).ToList(), + RequirePkce = entity.RequirePkce, + AllowPlainTextPkce = entity.AllowPlainTextPkce, + RequireRequestObject = entity.RequireRequestObject, + RequirePushedAuthorization = entity.RequirePushedAuthorization, + AllowAccessTokensViaBrowser = entity.AllowAccessTokensViaBrowser, + RedirectUris = MappingHelpers.MapStrings(entity.RedirectUris, x => x.RedirectUri), + PostLogoutRedirectUris = MappingHelpers.MapStrings(entity.PostLogoutRedirectUris, x => x.PostLogoutRedirectUri), + FrontChannelLogoutUri = entity.FrontChannelLogoutUri, + FrontChannelLogoutSessionRequired = entity.FrontChannelLogoutSessionRequired, + BackChannelLogoutUri = entity.BackChannelLogoutUri, + BackChannelLogoutSessionRequired = entity.BackChannelLogoutSessionRequired, + AllowOfflineAccess = entity.AllowOfflineAccess, + AllowedScopes = MappingHelpers.MapStrings(entity.AllowedScopes, x => x.Scope), + IdentityTokenLifetime = entity.IdentityTokenLifetime, + AllowedIdentityTokenSigningAlgorithms = AllowedSigningAlgorithmsConverter.Convert(entity.AllowedIdentityTokenSigningAlgorithms), + AccessTokenLifetime = entity.AccessTokenLifetime, + AuthorizationCodeLifetime = entity.AuthorizationCodeLifetime, + ConsentLifetime = entity.ConsentLifetime, + AbsoluteRefreshTokenLifetime = entity.AbsoluteRefreshTokenLifetime, + SlidingRefreshTokenLifetime = entity.SlidingRefreshTokenLifetime, + RefreshTokenUsage = (TokenUsage)entity.RefreshTokenUsage, + UpdateAccessTokenClaimsOnRefresh = entity.UpdateAccessTokenClaimsOnRefresh, + RefreshTokenExpiration = (TokenExpiration)entity.RefreshTokenExpiration, + AccessTokenType = (AccessTokenType)entity.AccessTokenType, + EnableLocalLogin = entity.EnableLocalLogin, + IdentityProviderRestrictions = MappingHelpers.MapStrings(entity.IdentityProviderRestrictions, x => x.Provider), + IncludeJwtId = entity.IncludeJwtId, + Claims = MappingHelpers.MapList(entity.Claims, x => new ClientClaim(x.Type, x.Value, ClaimValueTypes.String)), + AlwaysSendClientClaims = entity.AlwaysSendClientClaims, + ClientClaimsPrefix = entity.ClientClaimsPrefix, + PairWiseSubjectSalt = entity.PairWiseSubjectSalt, + AllowedCorsOrigins = MappingHelpers.MapStrings(entity.AllowedCorsOrigins, x => x.Origin), + Properties = MappingHelpers.MapProperties(entity.Properties), + UserSsoLifetime = entity.UserSsoLifetime, + UserCodeType = entity.UserCodeType, + DeviceCodeLifetime = entity.DeviceCodeLifetime, + ClientSecrets = MappingHelpers.MapList(entity.ClientSecrets, MappingHelpers.ToSecret) + }; + + if (entity.ProtocolType != null) + { + model.ProtocolType = entity.ProtocolType; + } + + return model; } /// @@ -36,7 +95,63 @@ public static Models.Client ToModel(this Entities.Client entity) /// public static Entities.Client ToEntity(this Models.Client model) { - return Mapper.Map(model); + if (model == null) + { + return null; + } + + return new Entities.Client + { + Enabled = model.Enabled, + ClientId = model.ClientId, + ProtocolType = model.ProtocolType, + RequireClientSecret = model.RequireClientSecret, + ClientName = model.ClientName, + Description = model.Description, + ClientUri = model.ClientUri, + LogoUri = model.LogoUri, + RequireConsent = model.RequireConsent, + AllowRememberConsent = model.AllowRememberConsent, + AlwaysIncludeUserClaimsInIdToken = model.AlwaysIncludeUserClaimsInIdToken, + AllowedGrantTypes = MappingHelpers.MapList(model.AllowedGrantTypes, x => new Entities.ClientGrantType { GrantType = x }), + RequirePkce = model.RequirePkce, + AllowPlainTextPkce = model.AllowPlainTextPkce, + RequireRequestObject = model.RequireRequestObject, + RequirePushedAuthorization = model.RequirePushedAuthorization, + AllowAccessTokensViaBrowser = model.AllowAccessTokensViaBrowser, + RedirectUris = MappingHelpers.MapList(model.RedirectUris, x => new Entities.ClientRedirectUri { RedirectUri = x }), + PostLogoutRedirectUris = MappingHelpers.MapList(model.PostLogoutRedirectUris, x => new Entities.ClientPostLogoutRedirectUri { PostLogoutRedirectUri = x }), + FrontChannelLogoutUri = model.FrontChannelLogoutUri, + FrontChannelLogoutSessionRequired = model.FrontChannelLogoutSessionRequired, + BackChannelLogoutUri = model.BackChannelLogoutUri, + BackChannelLogoutSessionRequired = model.BackChannelLogoutSessionRequired, + AllowOfflineAccess = model.AllowOfflineAccess, + AllowedScopes = MappingHelpers.MapList(model.AllowedScopes, x => new Entities.ClientScope { Scope = x }), + IdentityTokenLifetime = model.IdentityTokenLifetime, + AllowedIdentityTokenSigningAlgorithms = AllowedSigningAlgorithmsConverter.Convert(model.AllowedIdentityTokenSigningAlgorithms), + AccessTokenLifetime = model.AccessTokenLifetime, + AuthorizationCodeLifetime = model.AuthorizationCodeLifetime, + ConsentLifetime = model.ConsentLifetime, + AbsoluteRefreshTokenLifetime = model.AbsoluteRefreshTokenLifetime, + SlidingRefreshTokenLifetime = model.SlidingRefreshTokenLifetime, + RefreshTokenUsage = (int)model.RefreshTokenUsage, + UpdateAccessTokenClaimsOnRefresh = model.UpdateAccessTokenClaimsOnRefresh, + RefreshTokenExpiration = (int)model.RefreshTokenExpiration, + AccessTokenType = (int)model.AccessTokenType, + EnableLocalLogin = model.EnableLocalLogin, + IdentityProviderRestrictions = MappingHelpers.MapList(model.IdentityProviderRestrictions, x => new Entities.ClientIdPRestriction { Provider = x }), + IncludeJwtId = model.IncludeJwtId, + Claims = MappingHelpers.MapList(model.Claims, x => new Entities.ClientClaim { Type = x.Type, Value = x.Value }), + AlwaysSendClientClaims = model.AlwaysSendClientClaims, + ClientClaimsPrefix = model.ClientClaimsPrefix, + PairWiseSubjectSalt = model.PairWiseSubjectSalt, + AllowedCorsOrigins = MappingHelpers.MapList(model.AllowedCorsOrigins, x => new Entities.ClientCorsOrigin { Origin = x }), + Properties = MappingHelpers.MapProperties(model.Properties), + UserSsoLifetime = model.UserSsoLifetime, + UserCodeType = model.UserCodeType, + DeviceCodeLifetime = model.DeviceCodeLifetime, + ClientSecrets = MappingHelpers.MapList(model.ClientSecrets, MappingHelpers.ToEntitySecret) + }; } } -} \ No newline at end of file +} diff --git a/src/EntityFramework.Storage/src/Mappers/IdentityResourceMapperProfile.cs b/src/EntityFramework.Storage/src/Mappers/IdentityResourceMapperProfile.cs deleted file mode 100644 index 85e109a7c..000000000 --- a/src/EntityFramework.Storage/src/Mappers/IdentityResourceMapperProfile.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using System.Collections.Generic; -using AutoMapper; - -namespace IdentityServer4.EntityFramework.Mappers -{ - /// - /// Defines entity/model mapping for identity resources. - /// - /// - public class IdentityResourceMapperProfile : Profile - { - /// - /// - /// - public IdentityResourceMapperProfile() - { - CreateMap>() - .ReverseMap(); - - CreateMap(MemberList.Destination) - .ConstructUsing(src => new Models.IdentityResource()) - .ReverseMap(); - - CreateMap() - .ConstructUsing(x => x.Type) - .ReverseMap() - .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src)); - } - } -} diff --git a/src/EntityFramework.Storage/src/Mappers/IdentityResourceMappers.cs b/src/EntityFramework.Storage/src/Mappers/IdentityResourceMappers.cs index 6391eb7d0..5f57324c7 100644 --- a/src/EntityFramework.Storage/src/Mappers/IdentityResourceMappers.cs +++ b/src/EntityFramework.Storage/src/Mappers/IdentityResourceMappers.cs @@ -2,24 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using AutoMapper; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; -namespace IdentityServer4.EntityFramework.Mappers +namespace ForgePoint.Identity.EntityFramework.Mappers { /// /// Extension methods to map to/from entity/model for identity resources. /// public static class IdentityResourceMappers { - static IdentityResourceMappers() - { - Mapper = new MapperConfiguration(cfg => cfg.AddProfile()) - .CreateMapper(); - } - - internal static IMapper Mapper { get; } - /// /// Maps an entity to a model. /// @@ -27,7 +18,23 @@ static IdentityResourceMappers() /// public static Models.IdentityResource ToModel(this IdentityResource entity) { - return entity == null ? null : Mapper.Map(entity); + if (entity == null) + { + return null; + } + + return new Models.IdentityResource + { + Enabled = entity.Enabled, + Name = entity.Name, + DisplayName = entity.DisplayName, + Description = entity.Description, + Required = entity.Required, + Emphasize = entity.Emphasize, + ShowInDiscoveryDocument = entity.ShowInDiscoveryDocument, + UserClaims = MappingHelpers.MapStrings(entity.UserClaims, x => x.Type), + Properties = MappingHelpers.MapProperties(entity.Properties) + }; } /// @@ -37,7 +44,23 @@ public static Models.IdentityResource ToModel(this IdentityResource entity) /// public static IdentityResource ToEntity(this Models.IdentityResource model) { - return model == null ? null : Mapper.Map(model); + if (model == null) + { + return null; + } + + return new IdentityResource + { + Enabled = model.Enabled, + Name = model.Name, + DisplayName = model.DisplayName, + Description = model.Description, + Required = model.Required, + Emphasize = model.Emphasize, + ShowInDiscoveryDocument = model.ShowInDiscoveryDocument, + UserClaims = MappingHelpers.MapList(model.UserClaims, x => new IdentityResourceClaim { Type = x }), + Properties = MappingHelpers.MapProperties(model.Properties) + }; } } -} \ No newline at end of file +} diff --git a/src/EntityFramework.Storage/src/Mappers/MappingHelpers.cs b/src/EntityFramework.Storage/src/Mappers/MappingHelpers.cs new file mode 100644 index 000000000..41beffa81 --- /dev/null +++ b/src/EntityFramework.Storage/src/Mappers/MappingHelpers.cs @@ -0,0 +1,96 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System; +using System.Collections.Generic; +using System.Linq; +using ForgePoint.Identity.EntityFramework.Entities; + +namespace ForgePoint.Identity.EntityFramework.Mappers +{ + internal static class MappingHelpers + { + public static List MapList(IEnumerable source, Func map) + { + if (source == null) + { + return new List(); + } + + return source.Select(map).ToList(); + } + + public static ICollection MapStrings(IEnumerable source, Func selector) + { + if (source == null) + { + return new HashSet(); + } + + return new HashSet(source.Select(selector)); + } + + public static Dictionary MapProperties(IEnumerable source) + { + if (source == null) + { + return new Dictionary(); + } + + // ToDictionary throws on duplicate keys, matching previous AutoMapper behavior. + return source.ToDictionary(x => x.Key, x => x.Value); + } + + public static List MapProperties(IDictionary source) + where TProperty : Property, new() + { + if (source == null) + { + return new List(); + } + + return source.Select(x => new TProperty { Key = x.Key, Value = x.Value }).ToList(); + } + + public static Models.Secret ToSecret(Entities.Secret entity) + { + if (entity == null) + { + return null; + } + + var secret = new Models.Secret + { + Description = entity.Description, + Value = entity.Value, + Expiration = entity.Expiration + }; + + // Preserve the model default (SharedSecret) when the entity type is null. + if (entity.Type != null) + { + secret.Type = entity.Type; + } + + return secret; + } + + public static TSecret ToEntitySecret(Models.Secret model) + where TSecret : Entities.Secret, new() + { + if (model == null) + { + return null; + } + + return new TSecret + { + Description = model.Description, + Value = model.Value, + Expiration = model.Expiration, + Type = model.Type + }; + } + } +} diff --git a/src/EntityFramework.Storage/src/Mappers/PersistedGrantMapperProfile.cs b/src/EntityFramework.Storage/src/Mappers/PersistedGrantMapperProfile.cs deleted file mode 100644 index 02a36ecfe..000000000 --- a/src/EntityFramework.Storage/src/Mappers/PersistedGrantMapperProfile.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using AutoMapper; - -namespace IdentityServer4.EntityFramework.Mappers -{ - /// - /// Defines entity/model mapping for persisted grants. - /// - /// - public class PersistedGrantMapperProfile:Profile - { - /// - /// - /// - /// - public PersistedGrantMapperProfile() - { - CreateMap(MemberList.Destination) - .ReverseMap(); - } - } -} diff --git a/src/EntityFramework.Storage/src/Mappers/PersistedGrantMappers.cs b/src/EntityFramework.Storage/src/Mappers/PersistedGrantMappers.cs index 09a3a9d11..0a91fa3a7 100644 --- a/src/EntityFramework.Storage/src/Mappers/PersistedGrantMappers.cs +++ b/src/EntityFramework.Storage/src/Mappers/PersistedGrantMappers.cs @@ -2,24 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using AutoMapper; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.EntityFramework.Mappers +namespace ForgePoint.Identity.EntityFramework.Mappers { /// /// Extension methods to map to/from entity/model for persisted grants. /// public static class PersistedGrantMappers { - static PersistedGrantMappers() - { - Mapper = new MapperConfiguration(cfg =>cfg.AddProfile()) - .CreateMapper(); - } - - internal static IMapper Mapper { get; } - /// /// Maps an entity to a model. /// @@ -27,7 +18,24 @@ static PersistedGrantMappers() /// public static PersistedGrant ToModel(this Entities.PersistedGrant entity) { - return entity == null ? null : Mapper.Map(entity); + if (entity == null) + { + return null; + } + + return new PersistedGrant + { + Key = entity.Key, + Type = entity.Type, + SubjectId = entity.SubjectId, + SessionId = entity.SessionId, + ClientId = entity.ClientId, + Description = entity.Description, + CreationTime = entity.CreationTime, + Expiration = entity.Expiration, + ConsumedTime = entity.ConsumedTime, + Data = entity.Data + }; } /// @@ -37,7 +45,14 @@ public static PersistedGrant ToModel(this Entities.PersistedGrant entity) /// public static Entities.PersistedGrant ToEntity(this PersistedGrant model) { - return model == null ? null : Mapper.Map(model); + if (model == null) + { + return null; + } + + var entity = new Entities.PersistedGrant(); + model.UpdateEntity(entity); + return entity; } /// @@ -47,7 +62,16 @@ public static Entities.PersistedGrant ToEntity(this PersistedGrant model) /// The entity. public static void UpdateEntity(this PersistedGrant model, Entities.PersistedGrant entity) { - Mapper.Map(model, entity); + entity.Key = model.Key; + entity.Type = model.Type; + entity.SubjectId = model.SubjectId; + entity.SessionId = model.SessionId; + entity.ClientId = model.ClientId; + entity.Description = model.Description; + entity.CreationTime = model.CreationTime; + entity.Expiration = model.Expiration; + entity.ConsumedTime = model.ConsumedTime; + entity.Data = model.Data; } } -} \ No newline at end of file +} diff --git a/src/EntityFramework.Storage/src/Mappers/ScopeMapperProfile.cs b/src/EntityFramework.Storage/src/Mappers/ScopeMapperProfile.cs deleted file mode 100644 index 67db0db4e..000000000 --- a/src/EntityFramework.Storage/src/Mappers/ScopeMapperProfile.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using System.Collections.Generic; -using AutoMapper; - -namespace IdentityServer4.EntityFramework.Mappers -{ - /// - /// Defines entity/model mapping for scopes. - /// - /// - public class ScopeMapperProfile : Profile - { - /// - /// - /// - public ScopeMapperProfile() - { - CreateMap>() - .ReverseMap(); - - CreateMap() - .ConstructUsing(x => x.Type) - .ReverseMap() - .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src)); - - CreateMap(MemberList.Destination) - .ConstructUsing(src => new Models.ApiScope()) - .ForMember(x => x.Properties, opts => opts.MapFrom(x => x.Properties)) - .ForMember(x => x.UserClaims, opts => opts.MapFrom(x => x.UserClaims)) - .ReverseMap(); - } - } -} diff --git a/src/EntityFramework.Storage/src/Mappers/ScopeMappers.cs b/src/EntityFramework.Storage/src/Mappers/ScopeMappers.cs index 21a6cd36d..52ef6cec8 100644 --- a/src/EntityFramework.Storage/src/Mappers/ScopeMappers.cs +++ b/src/EntityFramework.Storage/src/Mappers/ScopeMappers.cs @@ -2,24 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using AutoMapper; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; -namespace IdentityServer4.EntityFramework.Mappers +namespace ForgePoint.Identity.EntityFramework.Mappers { /// /// Extension methods to map to/from entity/model for scopes. /// public static class ScopeMappers { - static ScopeMappers() - { - Mapper = new MapperConfiguration(cfg => cfg.AddProfile()) - .CreateMapper(); - } - - internal static IMapper Mapper { get; } - /// /// Maps an entity to a model. /// @@ -27,7 +18,23 @@ static ScopeMappers() /// public static Models.ApiScope ToModel(this ApiScope entity) { - return entity == null ? null : Mapper.Map(entity); + if (entity == null) + { + return null; + } + + return new Models.ApiScope + { + Enabled = entity.Enabled, + Name = entity.Name, + DisplayName = entity.DisplayName, + Description = entity.Description, + Required = entity.Required, + Emphasize = entity.Emphasize, + ShowInDiscoveryDocument = entity.ShowInDiscoveryDocument, + UserClaims = MappingHelpers.MapStrings(entity.UserClaims, x => x.Type), + Properties = MappingHelpers.MapProperties(entity.Properties) + }; } /// @@ -37,7 +44,23 @@ public static Models.ApiScope ToModel(this ApiScope entity) /// public static ApiScope ToEntity(this Models.ApiScope model) { - return model == null ? null : Mapper.Map(model); + if (model == null) + { + return null; + } + + return new ApiScope + { + Enabled = model.Enabled, + Name = model.Name, + DisplayName = model.DisplayName, + Description = model.Description, + Required = model.Required, + Emphasize = model.Emphasize, + ShowInDiscoveryDocument = model.ShowInDiscoveryDocument, + UserClaims = MappingHelpers.MapList(model.UserClaims, x => new ApiScopeClaim { Type = x }), + Properties = MappingHelpers.MapProperties(model.Properties) + }; } } -} \ No newline at end of file +} diff --git a/src/EntityFramework.Storage/src/Options/ConfigurationStoreOptions.cs b/src/EntityFramework.Storage/src/Options/ConfigurationStoreOptions.cs index bd8d05873..dc8a20f29 100644 --- a/src/EntityFramework.Storage/src/Options/ConfigurationStoreOptions.cs +++ b/src/EntityFramework.Storage/src/Options/ConfigurationStoreOptions.cs @@ -5,7 +5,7 @@ using System; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.Options +namespace ForgePoint.Identity.EntityFramework.Options { /// /// Options for configuring the configuration context. diff --git a/src/EntityFramework.Storage/src/Options/OperationalStoreOptions.cs b/src/EntityFramework.Storage/src/Options/OperationalStoreOptions.cs index 382333590..e6274a561 100644 --- a/src/EntityFramework.Storage/src/Options/OperationalStoreOptions.cs +++ b/src/EntityFramework.Storage/src/Options/OperationalStoreOptions.cs @@ -5,7 +5,7 @@ using System; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.Options +namespace ForgePoint.Identity.EntityFramework.Options { /// /// Options for configuring the operational context. diff --git a/src/EntityFramework.Storage/src/Options/TableConfiguration.cs b/src/EntityFramework.Storage/src/Options/TableConfiguration.cs index f7bd10751..3bc324912 100644 --- a/src/EntityFramework.Storage/src/Options/TableConfiguration.cs +++ b/src/EntityFramework.Storage/src/Options/TableConfiguration.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.EntityFramework.Options +namespace ForgePoint.Identity.EntityFramework.Options { /// /// Class to control a table's name and schema. diff --git a/src/EntityFramework.Storage/src/Stores/ClientStore.cs b/src/EntityFramework.Storage/src/Stores/ClientStore.cs index bcd0e92c8..98b9d5b90 100644 --- a/src/EntityFramework.Storage/src/Stores/ClientStore.cs +++ b/src/EntityFramework.Storage/src/Stores/ClientStore.cs @@ -5,19 +5,19 @@ using System; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -namespace IdentityServer4.EntityFramework.Stores +namespace ForgePoint.Identity.EntityFramework.Stores { /// /// Implementation of IClientStore thats uses EF. /// - /// + /// public class ClientStore : IClientStore { /// diff --git a/src/EntityFramework.Storage/src/Stores/DeviceFlowStore.cs b/src/EntityFramework.Storage/src/Stores/DeviceFlowStore.cs index e4053009c..93c6d3f7e 100644 --- a/src/EntityFramework.Storage/src/Stores/DeviceFlowStore.cs +++ b/src/EntityFramework.Storage/src/Stores/DeviceFlowStore.cs @@ -6,20 +6,20 @@ using System.Linq; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -namespace IdentityServer4.EntityFramework.Stores +namespace ForgePoint.Identity.EntityFramework.Stores { /// /// Implementation of IDeviceFlowStore thats uses EF. /// - /// + /// public class DeviceFlowStore : IDeviceFlowStore { /// diff --git a/src/EntityFramework.Storage/src/Stores/PersistedGrantStore.cs b/src/EntityFramework.Storage/src/Stores/PersistedGrantStore.cs index 37847605e..3f2728cdb 100644 --- a/src/EntityFramework.Storage/src/Stores/PersistedGrantStore.cs +++ b/src/EntityFramework.Storage/src/Stores/PersistedGrantStore.cs @@ -5,21 +5,21 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Logging; using Microsoft.EntityFrameworkCore; using System; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.EntityFramework.Stores +namespace ForgePoint.Identity.EntityFramework.Stores { /// /// Implementation of IPersistedGrantStore thats uses EF. /// - /// + /// public class PersistedGrantStore : IPersistedGrantStore { /// diff --git a/src/EntityFramework.Storage/src/Stores/ResourceStore.cs b/src/EntityFramework.Storage/src/Stores/ResourceStore.cs index b3cee973e..508e81a03 100644 --- a/src/EntityFramework.Storage/src/Stores/ResourceStore.cs +++ b/src/EntityFramework.Storage/src/Stores/ResourceStore.cs @@ -6,19 +6,19 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -namespace IdentityServer4.EntityFramework.Stores +namespace ForgePoint.Identity.EntityFramework.Stores { /// /// Implementation of IResourceStore thats uses EF. /// - /// + /// public class ResourceStore : IResourceStore { /// diff --git a/src/EntityFramework.Storage/src/TokenCleanup/IOperationalStoreNotification.cs b/src/EntityFramework.Storage/src/TokenCleanup/IOperationalStoreNotification.cs index cbe4af331..8c103f3c8 100644 --- a/src/EntityFramework.Storage/src/TokenCleanup/IOperationalStoreNotification.cs +++ b/src/EntityFramework.Storage/src/TokenCleanup/IOperationalStoreNotification.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; -namespace IdentityServer4.EntityFramework +namespace ForgePoint.Identity.EntityFramework { /// /// Interface to model notifications from the TokenCleanup feature. diff --git a/src/EntityFramework.Storage/src/TokenCleanup/TokenCleanupService.cs b/src/EntityFramework.Storage/src/TokenCleanup/TokenCleanupService.cs index 2b898d211..acc341bf4 100644 --- a/src/EntityFramework.Storage/src/TokenCleanup/TokenCleanupService.cs +++ b/src/EntityFramework.Storage/src/TokenCleanup/TokenCleanupService.cs @@ -5,13 +5,13 @@ using System; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Options; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -namespace IdentityServer4.EntityFramework +namespace ForgePoint.Identity.EntityFramework { /// /// Helper to cleanup stale persisted grants and device codes. diff --git a/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderBuilder.cs b/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderBuilder.cs index ec4e4c8ec..4c8aaab68 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderBuilder.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderBuilder.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { /// /// Helper methods to initialize DbContextOptions for the specified database provider and context. @@ -21,7 +21,7 @@ public static DbContextOptions BuildInMemory(string name) where T : DbCont public static DbContextOptions BuildSqlite(string name) where T : DbContext { var builder = new DbContextOptionsBuilder(); - builder.UseSqlite($"Filename=./Test.IdentityServer4.EntityFramework-3.1.0.{name}.db"); + builder.UseSqlite($"Filename=./Test.ForgePoint.Identity.EntityFramework-3.1.0.{name}.db"); return builder.Options; } @@ -29,7 +29,7 @@ public static DbContextOptions BuildLocalDb(string name) where T : DbConte { var builder = new DbContextOptionsBuilder(); builder.UseSqlServer( - $@"Data Source=(LocalDb)\MSSQLLocalDB;database=Test.IdentityServer4.EntityFramework-3.1.0.{name};trusted_connection=yes;"); + $@"Data Source=(LocalDb)\MSSQLLocalDB;database=Test.ForgePoint.Identity.EntityFramework-3.1.0.{name};trusted_connection=yes;"); return builder.Options; } } diff --git a/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderFixture.cs b/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderFixture.cs index b441a0c1d..40308bec1 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderFixture.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/DatabaseProviderFixture.cs @@ -7,7 +7,7 @@ using System.Linq; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { /// /// xUnit ClassFixture for creating and deleting integration test databases. diff --git a/src/EntityFramework.Storage/test/IntegrationTests/DbContexts/ClientDbContextTests.cs b/src/EntityFramework.Storage/test/IntegrationTests/DbContexts/ClientDbContextTests.cs index bc4e16bcb..9dcad36d6 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/DbContexts/ClientDbContextTests.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/DbContexts/ClientDbContextTests.cs @@ -2,20 +2,20 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using System.Linq; -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Options; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests.DbContexts +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.DbContexts { public class ClientDbContextTests : IntegrationTest { public ClientDbContextTests(DatabaseProviderFixture fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new ConfigurationDbContext(options, StoreOptions)) context.Database.EnsureCreated(); diff --git a/src/EntityFramework.Storage/test/IntegrationTests/FakeLogger.cs b/src/EntityFramework.Storage/test/IntegrationTests/FakeLogger.cs index 9327d0cf6..423885016 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/FakeLogger.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/FakeLogger.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Logging; using System; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { public class FakeLogger : FakeLogger, ILogger { diff --git a/src/EntityFramework.Storage/test/IntegrationTests/IdentityServer4.EntityFramework.IntegrationTests.csproj b/src/EntityFramework.Storage/test/IntegrationTests/IdentityServer4.EntityFramework.IntegrationTests.csproj index 754006b8e..42b757dd6 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/IdentityServer4.EntityFramework.IntegrationTests.csproj +++ b/src/EntityFramework.Storage/test/IntegrationTests/IdentityServer4.EntityFramework.IntegrationTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 ../../../../key.snk true @@ -17,8 +17,8 @@ - - + + diff --git a/src/EntityFramework.Storage/test/IntegrationTests/IntegrationTest.cs b/src/EntityFramework.Storage/test/IntegrationTests/IntegrationTest.cs index aee3156d8..96bc3091e 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/IntegrationTest.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/IntegrationTest.cs @@ -1,11 +1,12 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { /// /// Base class for integration tests, responsible for initializing test database providers & an xUnit class fixture @@ -50,8 +51,16 @@ static IntegrationTest() protected IntegrationTest(DatabaseProviderFixture fixture) { - fixture.Options = TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList(); + fixture.Options = GetTestDatabaseOptions(); fixture.StoreOptions = StoreOptions; } + + protected List> GetTestDatabaseOptions() + { + return TestDatabaseProviders + .Cast() + .Select(row => (DbContextOptions)row[0]) + .ToList(); + } } } \ No newline at end of file diff --git a/src/EntityFramework.Storage/test/IntegrationTests/Stores/ClientStoreTests.cs b/src/EntityFramework.Storage/test/IntegrationTests/Stores/ClientStoreTests.cs index 8e2bf8160..213af1429 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/Stores/ClientStoreTests.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/Stores/ClientStoreTests.cs @@ -6,22 +6,22 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework.Stores; -using IdentityServer4.Models; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Stores; +using ForgePoint.Identity.Models; using Microsoft.EntityFrameworkCore; using Xunit; using Xunit.Sdk; -namespace IdentityServer4.EntityFramework.IntegrationTests.Stores +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.Stores { public class ClientStoreTests : IntegrationTest { public ClientStoreTests(DatabaseProviderFixture fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions) y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new ConfigurationDbContext(options, StoreOptions)) { diff --git a/src/EntityFramework.Storage/test/IntegrationTests/Stores/DeviceFlowStoreTests.cs b/src/EntityFramework.Storage/test/IntegrationTests/Stores/DeviceFlowStoreTests.cs index 471deba07..d754ae073 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/Stores/DeviceFlowStoreTests.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/Stores/DeviceFlowStoreTests.cs @@ -1,9 +1,9 @@ using FluentAssertions; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework.Stores; -using IdentityServer4.Models; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; @@ -11,11 +11,11 @@ using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Entities; using Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests.Stores +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.Stores { public class DeviceFlowStoreTests : IntegrationTest { @@ -23,7 +23,7 @@ public class DeviceFlowStoreTests : IntegrationTest fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new PersistedGrantDbContext(options, StoreOptions)) context.Database.EnsureCreated(); diff --git a/src/EntityFramework.Storage/test/IntegrationTests/Stores/PersistedGrantStoreTests.cs b/src/EntityFramework.Storage/test/IntegrationTests/Stores/PersistedGrantStoreTests.cs index c6b1f5999..9eb4be41f 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/Stores/PersistedGrantStoreTests.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/Stores/PersistedGrantStoreTests.cs @@ -7,23 +7,23 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework.Stores; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.EntityFrameworkCore; using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests.Stores +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.Stores { public class PersistedGrantStoreTests : IntegrationTest { public PersistedGrantStoreTests(DatabaseProviderFixture fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new PersistedGrantDbContext(options, StoreOptions)) context.Database.EnsureCreated(); diff --git a/src/EntityFramework.Storage/test/IntegrationTests/Stores/ResourceStoreTests.cs b/src/EntityFramework.Storage/test/IntegrationTests/Stores/ResourceStoreTests.cs index e2709f067..6ca2eafab 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/Stores/ResourceStoreTests.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/Stores/ResourceStoreTests.cs @@ -7,21 +7,21 @@ using System.Linq; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework.Stores; -using IdentityServer4.Models; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Stores; +using ForgePoint.Identity.Models; using Microsoft.EntityFrameworkCore; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests.Stores +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.Stores { public class ScopeStoreTests : IntegrationTest { public ScopeStoreTests(DatabaseProviderFixture fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new ConfigurationDbContext(options, StoreOptions)) context.Database.EnsureCreated(); diff --git a/src/EntityFramework.Storage/test/IntegrationTests/TokenCleanup/TokenCleanupTests.cs b/src/EntityFramework.Storage/test/IntegrationTests/TokenCleanup/TokenCleanupTests.cs index ecfcda3fa..d35ed6944 100644 --- a/src/EntityFramework.Storage/test/IntegrationTests/TokenCleanup/TokenCleanupTests.cs +++ b/src/EntityFramework.Storage/test/IntegrationTests/TokenCleanup/TokenCleanupTests.cs @@ -3,18 +3,18 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Entities; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework.Stores; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Stores; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests.TokenCleanup +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.TokenCleanup { public class TokenCleanupTests : IntegrationTest { @@ -22,7 +22,7 @@ public class TokenCleanupTests : IntegrationTest fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new PersistedGrantDbContext(options, StoreOptions)) { diff --git a/src/EntityFramework.Storage/test/UnitTests/IdentityServer4.EntityFramework.UnitTests.csproj b/src/EntityFramework.Storage/test/UnitTests/IdentityServer4.EntityFramework.UnitTests.csproj index c350083d4..a4b37561b 100644 --- a/src/EntityFramework.Storage/test/UnitTests/IdentityServer4.EntityFramework.UnitTests.csproj +++ b/src/EntityFramework.Storage/test/UnitTests/IdentityServer4.EntityFramework.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 ../../../../key.snk true diff --git a/src/EntityFramework.Storage/test/UnitTests/Mappers/ApiResourceMappersTests.cs b/src/EntityFramework.Storage/test/UnitTests/Mappers/ApiResourceMappersTests.cs index ec55c1a66..b6d977cc4 100644 --- a/src/EntityFramework.Storage/test/UnitTests/Mappers/ApiResourceMappersTests.cs +++ b/src/EntityFramework.Storage/test/UnitTests/Mappers/ApiResourceMappersTests.cs @@ -4,20 +4,14 @@ using System.Linq; using FluentAssertions; -using IdentityServer4.EntityFramework.Mappers; +using ForgePoint.Identity.EntityFramework.Mappers; using Xunit; -using ApiResource = IdentityServer4.Models.ApiResource; +using ApiResource = ForgePoint.Identity.Models.ApiResource; -namespace IdentityServer4.EntityFramework.UnitTests.Mappers +namespace ForgePoint.Identity.EntityFramework.UnitTests.Mappers { public class ApiResourceMappersTests { - [Fact] - public void AutomapperConfigurationIsValid() - { - ApiResourceMappers.Mapper.ConfigurationProvider.AssertConfigurationIsValid(); - } - [Fact] public void Can_Map() { @@ -62,7 +56,7 @@ public void Properties_Map() [Fact] public void missing_values_should_use_defaults() { - var entity = new IdentityServer4.EntityFramework.Entities.ApiResource + var entity = new ForgePoint.Identity.EntityFramework.Entities.ApiResource { Secrets = new System.Collections.Generic.List { diff --git a/src/EntityFramework.Storage/test/UnitTests/Mappers/ClientMappersTests.cs b/src/EntityFramework.Storage/test/UnitTests/Mappers/ClientMappersTests.cs index 99a0e4459..6b5360b4f 100644 --- a/src/EntityFramework.Storage/test/UnitTests/Mappers/ClientMappersTests.cs +++ b/src/EntityFramework.Storage/test/UnitTests/Mappers/ClientMappersTests.cs @@ -5,20 +5,14 @@ using System; using System.Linq; using FluentAssertions; -using IdentityServer4.EntityFramework.Mappers; +using ForgePoint.Identity.EntityFramework.Mappers; using Xunit; -using Client = IdentityServer4.Models.Client; +using Client = ForgePoint.Identity.Models.Client; -namespace IdentityServer4.EntityFramework.UnitTests.Mappers +namespace ForgePoint.Identity.EntityFramework.UnitTests.Mappers { public class ClientMappersTests { - [Fact] - public void AutomapperConfigurationIsValid() - { - ClientMappers.Mapper.ConfigurationProvider.AssertConfigurationIsValid(); - } - [Fact] public void Can_Map() { @@ -67,7 +61,7 @@ public void Properties_Map() [Fact] public void duplicates_properties_in_db_map() { - var entity = new IdentityServer4.EntityFramework.Entities.Client + var entity = new ForgePoint.Identity.EntityFramework.Entities.Client { Properties = new System.Collections.Generic.List() { @@ -83,12 +77,14 @@ public void duplicates_properties_in_db_map() [Fact] public void missing_values_should_use_defaults() { - var entity = new IdentityServer4.EntityFramework.Entities.Client + var entity = new ForgePoint.Identity.EntityFramework.Entities.Client { + ProtocolType = null, ClientSecrets = new System.Collections.Generic.List { new Entities.ClientSecret { + Type = null } } }; @@ -102,5 +98,55 @@ public void missing_values_should_use_defaults() model.ProtocolType.Should().Be(def.ProtocolType); model.ClientSecrets.First().Type.Should().Be(def.ClientSecrets.First().Type); } + + [Fact] + public void collections_and_signing_algorithms_map() + { + var model = new Client + { + ClientId = "client", + AllowedGrantTypes = { "authorization_code" }, + AllowedScopes = { "openid", "api" }, + RedirectUris = { "https://client/callback" }, + PostLogoutRedirectUris = { "https://client/logout" }, + AllowedCorsOrigins = { "https://client" }, + IdentityProviderRestrictions = { "google" }, + AllowedIdentityTokenSigningAlgorithms = { "RS256", "PS256" }, + Claims = { new Models.ClientClaim("role", "admin") }, + IncludeJwtId = true, + AccessTokenType = Models.AccessTokenType.Reference, + RefreshTokenUsage = Models.TokenUsage.ReUse, + RefreshTokenExpiration = Models.TokenExpiration.Sliding + }; + + var mappedEntity = model.ToEntity(); + mappedEntity.AllowedGrantTypes.Select(x => x.GrantType).Should().BeEquivalentTo(new[] { "authorization_code" }); + mappedEntity.AllowedScopes.Select(x => x.Scope).Should().BeEquivalentTo(new[] { "openid", "api" }); + mappedEntity.RedirectUris.Select(x => x.RedirectUri).Should().BeEquivalentTo(new[] { "https://client/callback" }); + mappedEntity.PostLogoutRedirectUris.Select(x => x.PostLogoutRedirectUri).Should().BeEquivalentTo(new[] { "https://client/logout" }); + mappedEntity.AllowedCorsOrigins.Select(x => x.Origin).Should().BeEquivalentTo(new[] { "https://client" }); + mappedEntity.IdentityProviderRestrictions.Select(x => x.Provider).Should().BeEquivalentTo(new[] { "google" }); + mappedEntity.AllowedIdentityTokenSigningAlgorithms.Should().Be("RS256,PS256"); + mappedEntity.Claims.Should().ContainSingle(x => x.Type == "role" && x.Value == "admin"); + mappedEntity.IncludeJwtId.Should().BeTrue(); + mappedEntity.AccessTokenType.Should().Be((int)Models.AccessTokenType.Reference); + mappedEntity.RefreshTokenUsage.Should().Be((int)Models.TokenUsage.ReUse); + mappedEntity.RefreshTokenExpiration.Should().Be((int)Models.TokenExpiration.Sliding); + + var mappedModel = mappedEntity.ToModel(); + mappedModel.ClientId.Should().Be("client"); + mappedModel.AllowedGrantTypes.Should().BeEquivalentTo(new[] { "authorization_code" }); + mappedModel.AllowedScopes.Should().BeEquivalentTo(new[] { "openid", "api" }); + mappedModel.RedirectUris.Should().BeEquivalentTo(new[] { "https://client/callback" }); + mappedModel.PostLogoutRedirectUris.Should().BeEquivalentTo(new[] { "https://client/logout" }); + mappedModel.AllowedCorsOrigins.Should().BeEquivalentTo(new[] { "https://client" }); + mappedModel.IdentityProviderRestrictions.Should().BeEquivalentTo(new[] { "google" }); + mappedModel.AllowedIdentityTokenSigningAlgorithms.Should().BeEquivalentTo(new[] { "RS256", "PS256" }); + mappedModel.Claims.Should().ContainSingle(x => x.Type == "role" && x.Value == "admin" && x.ValueType == System.Security.Claims.ClaimValueTypes.String); + mappedModel.IncludeJwtId.Should().BeTrue(); + mappedModel.AccessTokenType.Should().Be(Models.AccessTokenType.Reference); + mappedModel.RefreshTokenUsage.Should().Be(Models.TokenUsage.ReUse); + mappedModel.RefreshTokenExpiration.Should().Be(Models.TokenExpiration.Sliding); + } } } \ No newline at end of file diff --git a/src/EntityFramework.Storage/test/UnitTests/Mappers/IdentityResourcesMappersTests.cs b/src/EntityFramework.Storage/test/UnitTests/Mappers/IdentityResourcesMappersTests.cs index fe2119319..e8ac43ec4 100644 --- a/src/EntityFramework.Storage/test/UnitTests/Mappers/IdentityResourcesMappersTests.cs +++ b/src/EntityFramework.Storage/test/UnitTests/Mappers/IdentityResourcesMappersTests.cs @@ -2,20 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; using Xunit; -namespace IdentityServer4.EntityFramework.UnitTests.Mappers +namespace ForgePoint.Identity.EntityFramework.UnitTests.Mappers { public class IdentityResourcesMappersTests { - [Fact] - public void IdentityResourceAutomapperConfigurationIsValid() - { - IdentityResourceMappers.Mapper.ConfigurationProvider.AssertConfigurationIsValid(); - } - [Fact] public void CanMapIdentityResources() { diff --git a/src/EntityFramework.Storage/test/UnitTests/Mappers/PersistedGrantMappersTests.cs b/src/EntityFramework.Storage/test/UnitTests/Mappers/PersistedGrantMappersTests.cs index 48fbeffb4..ae20754c5 100644 --- a/src/EntityFramework.Storage/test/UnitTests/Mappers/PersistedGrantMappersTests.cs +++ b/src/EntityFramework.Storage/test/UnitTests/Mappers/PersistedGrantMappersTests.cs @@ -3,20 +3,14 @@ using FluentAssertions; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; using Xunit; -namespace IdentityServer4.EntityFramework.UnitTests.Mappers +namespace ForgePoint.Identity.EntityFramework.UnitTests.Mappers { public class PersistedGrantMappersTests { - [Fact] - public void PersistedGrantAutomapperConfigurationIsValid() - { - PersistedGrantMappers.Mapper.ConfigurationProvider.AssertConfigurationIsValid(); - } - [Fact] public void CanMap() { @@ -34,5 +28,43 @@ public void CanMap() Assert.NotNull(mappedModel); Assert.NotNull(mappedEntity); } + + [Fact] + public void UpdateEntity_overwrites_existing_values() + { + var entity = new Entities.PersistedGrant + { + Key = "old", + Data = "old-data", + ConsumedTime = null + }; + + var model = new PersistedGrant + { + Key = "new", + Type = "refresh_token", + SubjectId = "sub", + SessionId = "sid", + ClientId = "client", + Description = "desc", + CreationTime = new System.DateTime(2020, 1, 2, 3, 4, 5), + Expiration = new System.DateTime(2020, 2, 3, 4, 5, 6), + ConsumedTime = new System.DateTime(2020, 02, 03, 4, 5, 6), + Data = "new-data" + }; + + model.UpdateEntity(entity); + + entity.Key.Should().Be("new"); + entity.Type.Should().Be("refresh_token"); + entity.SubjectId.Should().Be("sub"); + entity.SessionId.Should().Be("sid"); + entity.ClientId.Should().Be("client"); + entity.Description.Should().Be("desc"); + entity.CreationTime.Should().Be(new System.DateTime(2020, 1, 2, 3, 4, 5)); + entity.Expiration.Should().Be(new System.DateTime(2020, 2, 3, 4, 5, 6)); + entity.ConsumedTime.Should().Be(new System.DateTime(2020, 02, 03, 4, 5, 6)); + entity.Data.Should().Be("new-data"); + } } } \ No newline at end of file diff --git a/src/EntityFramework.Storage/test/UnitTests/Mappers/ScopeMappersTests.cs b/src/EntityFramework.Storage/test/UnitTests/Mappers/ScopeMappersTests.cs index 2765e4aa4..48ece2198 100644 --- a/src/EntityFramework.Storage/test/UnitTests/Mappers/ScopeMappersTests.cs +++ b/src/EntityFramework.Storage/test/UnitTests/Mappers/ScopeMappersTests.cs @@ -4,20 +4,14 @@ using System.Linq; using FluentAssertions; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; using Xunit; -namespace IdentityServer4.EntityFramework.UnitTests.Mappers +namespace ForgePoint.Identity.EntityFramework.UnitTests.Mappers { public class ScopesMappersTests { - [Fact] - public void ScopeAutomapperConfigurationIsValid() - { - ScopeMappers.Mapper.ConfigurationProvider.AssertConfigurationIsValid(); - } - [Fact] public void CanMapScope() { diff --git a/src/EntityFramework/README.md b/src/EntityFramework/README.md index 14efb7a2b..6efa2853f 100644 --- a/src/EntityFramework/README.md +++ b/src/EntityFramework/README.md @@ -1,7 +1,7 @@ -# IdentityServer4.EntityFramework +# ForgePoint.Identity.EntityFramework -IdentityServer4.EntityFramework is a package that provides the configuration APIs to add persistence for IdentityServer 4 configuration data that uses EntityFramework as its database abstraction. +ForgePoint.Identity.EntityFramework provides the configuration APIs to persist ForgePoint.Identity (IdentityServer4-compatible) configuration data with Entity Framework Core. ## Issues -For issues, use the [consolidated IdentityServer4 issue tracker](https://github.com/IdentityServer/IdentityServer4/issues). +Open issues on this repository. diff --git a/src/EntityFramework/build/Program.cs b/src/EntityFramework/build/Program.cs index 2c1d2fe65..3e7ef6b64 100644 --- a/src/EntityFramework/build/Program.cs +++ b/src/EntityFramework/build/Program.cs @@ -2,6 +2,6 @@ { partial class Program { - private const string Prefix = "EntityFramework"; + private const string Prefix = "ForgePoint.Identity.EntityFramework"; } } diff --git a/src/EntityFramework/build/build.csproj b/src/EntityFramework/build/build.csproj index 43c81aaed..f1804320d 100644 --- a/src/EntityFramework/build/build.csproj +++ b/src/EntityFramework/build/build.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/src/EntityFramework/host/Host.csproj b/src/EntityFramework/host/Host.csproj index 0fc6e1beb..fb0803d81 100644 --- a/src/EntityFramework/host/Host.csproj +++ b/src/EntityFramework/host/Host.csproj @@ -1,13 +1,10 @@  - netcoreapp3.1 + net10.0 - - - - + diff --git a/src/EntityFramework/host/Program.cs b/src/EntityFramework/host/Program.cs index ca520d3f0..5f2018a2c 100644 --- a/src/EntityFramework/host/Program.cs +++ b/src/EntityFramework/host/Program.cs @@ -16,7 +16,7 @@ public class Program { public static int Main(string[] args) { - Console.Title = "IdentityServer4.EntityFramework"; + Console.Title = "ForgePoint.Identity.EntityFramework"; Activity.DefaultIdFormat = ActivityIdFormat.W3C; Log.Logger = new LoggerConfiguration() diff --git a/src/EntityFramework/host/Quickstart/Account/AccountController.cs b/src/EntityFramework/host/Quickstart/Account/AccountController.cs index 2d51c3cd0..603872753 100644 --- a/src/EntityFramework/host/Quickstart/Account/AccountController.cs +++ b/src/EntityFramework/host/Quickstart/Account/AccountController.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -242,7 +242,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -344,7 +344,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/src/EntityFramework/host/Quickstart/Account/ExternalController.cs b/src/EntityFramework/host/Quickstart/Account/ExternalController.cs index 1a7479ea1..00c199652 100644 --- a/src/EntityFramework/host/Quickstart/Account/ExternalController.cs +++ b/src/EntityFramework/host/Quickstart/Account/ExternalController.cs @@ -1,9 +1,9 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/src/EntityFramework/host/Quickstart/Consent/ConsentController.cs b/src/EntityFramework/host/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/src/EntityFramework/host/Quickstart/Consent/ConsentController.cs +++ b/src/EntityFramework/host/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/EntityFramework/host/Quickstart/Consent/ProcessConsentResult.cs b/src/EntityFramework/host/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/src/EntityFramework/host/Quickstart/Consent/ProcessConsentResult.cs +++ b/src/EntityFramework/host/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/EntityFramework/host/Quickstart/Device/DeviceController.cs b/src/EntityFramework/host/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/src/EntityFramework/host/Quickstart/Device/DeviceController.cs +++ b/src/EntityFramework/host/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/EntityFramework/host/Quickstart/Extensions.cs b/src/EntityFramework/host/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/src/EntityFramework/host/Quickstart/Extensions.cs +++ b/src/EntityFramework/host/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/src/EntityFramework/host/Quickstart/Grants/GrantsController.cs b/src/EntityFramework/host/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/src/EntityFramework/host/Quickstart/Grants/GrantsController.cs +++ b/src/EntityFramework/host/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/EntityFramework/host/Quickstart/Home/ErrorViewModel.cs b/src/EntityFramework/host/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/src/EntityFramework/host/Quickstart/Home/ErrorViewModel.cs +++ b/src/EntityFramework/host/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/EntityFramework/host/Quickstart/Home/HomeController.cs b/src/EntityFramework/host/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/src/EntityFramework/host/Quickstart/Home/HomeController.cs +++ b/src/EntityFramework/host/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/src/EntityFramework/host/Quickstart/TestUsers.cs b/src/EntityFramework/host/Quickstart/TestUsers.cs index b4d2f821f..fa1df9572 100644 --- a/src/EntityFramework/host/Quickstart/TestUsers.cs +++ b/src/EntityFramework/host/Quickstart/TestUsers.cs @@ -3,7 +3,7 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; @@ -22,7 +22,7 @@ public class TestUsers new Claim(JwtClaimTypes.Email, "AliceSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://alice.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json) } }, new TestUser{SubjectId = "88421113", Username = "bob", Password = "bob", @@ -34,7 +34,7 @@ public class TestUsers new Claim(JwtClaimTypes.Email, "BobSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://bob.com"), - new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), + new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", ForgePoint.Identity.IdentityServerConstants.ClaimValueTypes.Json), new Claim("location", "somewhere") } } diff --git a/src/EntityFramework/host/TestOperationalStoreNotification.cs b/src/EntityFramework/host/TestOperationalStoreNotification.cs index ab7a8c36d..a8342db06 100644 --- a/src/EntityFramework/host/TestOperationalStoreNotification.cs +++ b/src/EntityFramework/host/TestOperationalStoreNotification.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.EntityFramework; -using IdentityServer4.EntityFramework.Entities; +using ForgePoint.Identity.EntityFramework; +using ForgePoint.Identity.EntityFramework.Entities; namespace IdentityServerHost { diff --git a/src/EntityFramework/host/Views/Home/Index.cshtml b/src/EntityFramework/host/Views/Home/Index.cshtml index 36b2bfc3a..1521e3ca5 100644 --- a/src/EntityFramework/host/Views/Home/Index.cshtml +++ b/src/EntityFramework/host/Views/Home/Index.cshtml @@ -1,13 +1,13 @@ @using System.Diagnostics @{ - var version = FileVersionInfo.GetVersionInfo(typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); + var version = FileVersionInfo.GetVersionInfo(typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.Location).ProductVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -25,8 +25,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/src/EntityFramework/host/Views/Shared/_Layout.cshtml b/src/EntityFramework/host/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/src/EntityFramework/host/Views/Shared/_Layout.cshtml +++ b/src/EntityFramework/host/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/src/EntityFramework/host/Views/Shared/_Nav.cshtml b/src/EntityFramework/host/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/src/EntityFramework/host/Views/Shared/_Nav.cshtml +++ b/src/EntityFramework/host/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/src/EntityFramework/migrations/SqlServer/Configuration/Clients.cs b/src/EntityFramework/migrations/SqlServer/Configuration/Clients.cs index ae2c6a1aa..eb652c28e 100644 --- a/src/EntityFramework/migrations/SqlServer/Configuration/Clients.cs +++ b/src/EntityFramework/migrations/SqlServer/Configuration/Clients.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServerHost.Configuration diff --git a/src/EntityFramework/migrations/SqlServer/Configuration/ClientsConsole.cs b/src/EntityFramework/migrations/SqlServer/Configuration/ClientsConsole.cs index 8e5792d85..27c6c0ae6 100644 --- a/src/EntityFramework/migrations/SqlServer/Configuration/ClientsConsole.cs +++ b/src/EntityFramework/migrations/SqlServer/Configuration/ClientsConsole.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Configuration { diff --git a/src/EntityFramework/migrations/SqlServer/Configuration/ClientsWeb.cs b/src/EntityFramework/migrations/SqlServer/Configuration/ClientsWeb.cs index 444b887b4..9909da1a3 100644 --- a/src/EntityFramework/migrations/SqlServer/Configuration/ClientsWeb.cs +++ b/src/EntityFramework/migrations/SqlServer/Configuration/ClientsWeb.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.using System.Collections.Generic; using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Configuration { diff --git a/src/EntityFramework/migrations/SqlServer/Configuration/Resources.cs b/src/EntityFramework/migrations/SqlServer/Configuration/Resources.cs index 12a33bbf4..f73afc04f 100644 --- a/src/EntityFramework/migrations/SqlServer/Configuration/Resources.cs +++ b/src/EntityFramework/migrations/SqlServer/Configuration/Resources.cs @@ -3,9 +3,9 @@ using IdentityModel; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; namespace IdentityServerHost.Configuration { diff --git a/src/EntityFramework/migrations/SqlServer/SeedData.cs b/src/EntityFramework/migrations/SqlServer/SeedData.cs index 18b9de96d..bf211bc39 100644 --- a/src/EntityFramework/migrations/SqlServer/SeedData.cs +++ b/src/EntityFramework/migrations/SqlServer/SeedData.cs @@ -1,9 +1,9 @@ using System; using System.Linq; using IdentityServerHost.Configuration; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Mappers; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Mappers; using Microsoft.Extensions.DependencyInjection; namespace SqlServer diff --git a/src/EntityFramework/migrations/SqlServer/SqlServer.csproj b/src/EntityFramework/migrations/SqlServer/SqlServer.csproj index 5136d9384..3f39e9356 100644 --- a/src/EntityFramework/migrations/SqlServer/SqlServer.csproj +++ b/src/EntityFramework/migrations/SqlServer/SqlServer.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/src/EntityFramework/src/IdentityServer4.EntityFramework.csproj b/src/EntityFramework/src/IdentityServer4.EntityFramework.csproj index 2941966a9..d5770f792 100644 --- a/src/EntityFramework/src/IdentityServer4.EntityFramework.csproj +++ b/src/EntityFramework/src/IdentityServer4.EntityFramework.csproj @@ -1,17 +1,15 @@  - IdentityServer4.EntityFramework - netcoreapp3.1 + ForgePoint.Identity.EntityFramework + net8.0;net10.0 - EntityFramework persistence layer for IdentityServer4 - Brock Allen;Dominick Baier;Scott Brady - IdentityServer4.EntityFramework - OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;IdentityServer;EntityFramework + EntityFramework persistence layer for ForgePoint.Identity + ForgePoint.Identity.EntityFramework + ForgePoint.Identity.EntityFramework + OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;ForgePoint;IdentityServer4;EntityFramework icon.jpg - https://github.com/IdentityServer/IdentityServer4 Apache-2.0 - https://github.com/IdentityServer/IdentityServer4/releases true true @@ -33,8 +31,8 @@ - - + + diff --git a/src/EntityFramework/src/IdentityServerEntityFrameworkBuilderExtensions.cs b/src/EntityFramework/src/IdentityServerEntityFrameworkBuilderExtensions.cs index ebc8fda5b..4c6802c60 100644 --- a/src/EntityFramework/src/IdentityServerEntityFrameworkBuilderExtensions.cs +++ b/src/EntityFramework/src/IdentityServerEntityFrameworkBuilderExtensions.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Services; -using IdentityServer4.EntityFramework.Stores; -using IdentityServer4.Stores; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Services; +using ForgePoint.Identity.EntityFramework.Stores; +using ForgePoint.Identity.Stores; using System; -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework; -using IdentityServer4.EntityFramework.Storage; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework; +using ForgePoint.Identity.EntityFramework.Storage; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; diff --git a/src/EntityFramework/src/Services/CorsPolicyService.cs b/src/EntityFramework/src/Services/CorsPolicyService.cs index a1fd10fda..2843ea8fd 100644 --- a/src/EntityFramework/src/Services/CorsPolicyService.cs +++ b/src/EntityFramework/src/Services/CorsPolicyService.cs @@ -4,20 +4,20 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using System.Linq; -using IdentityServer4.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Interfaces; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.Services +namespace ForgePoint.Identity.EntityFramework.Services { /// /// Implementation of ICorsPolicyService that consults the client configuration in the database for allowed CORS origins. /// - /// + /// public class CorsPolicyService : ICorsPolicyService { private readonly IHttpContextAccessor _context; diff --git a/src/EntityFramework/src/TokenCleanupHost.cs b/src/EntityFramework/src/TokenCleanupHost.cs index ed2c24b1f..50e7f0e45 100644 --- a/src/EntityFramework/src/TokenCleanupHost.cs +++ b/src/EntityFramework/src/TokenCleanupHost.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.EntityFramework.Options; -using IdentityServer4.EntityFramework; +using ForgePoint.Identity.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework; using Microsoft.Extensions.Hosting; using System.Threading; using System.Threading.Tasks; diff --git a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderBuilder.cs b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderBuilder.cs index ffd1134f4..00241a1d9 100644 --- a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderBuilder.cs +++ b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderBuilder.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { /// /// Helper methods to initialize DbContextOptions for the specified database provider and context. @@ -21,7 +21,7 @@ public static DbContextOptions BuildInMemory(string name) where T : DbCont public static DbContextOptions BuildSqlite(string name) where T : DbContext { var builder = new DbContextOptionsBuilder(); - builder.UseSqlite($"Filename=./Test.IdentityServer4.EntityFramework-3.1.0.{name}.db"); + builder.UseSqlite($"Filename=./Test.ForgePoint.Identity.EntityFramework-3.1.0.{name}.db"); return builder.Options; } @@ -29,14 +29,14 @@ public static DbContextOptions BuildLocalDb(string name) where T : DbConte { var builder = new DbContextOptionsBuilder(); builder.UseSqlServer( - $@"Data Source=(LocalDb)\MSSQLLocalDB;database=Test.IdentityServer4.EntityFramework-3.1.0.{name};trusted_connection=yes;"); + $@"Data Source=(LocalDb)\MSSQLLocalDB;database=Test.ForgePoint.Identity.EntityFramework-3.1.0.{name};trusted_connection=yes;"); return builder.Options; } public static DbContextOptions BuildAppVeyorSqlServer2016(string name) where T : DbContext { var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer($@"Server=(local)\SQL2016;Database=Test.IdentityServer4.EntityFramework-3.1.0.{name};User ID=sa;Password=Password12!"); + builder.UseSqlServer($@"Server=(local)\SQL2016;Database=Test.ForgePoint.Identity.EntityFramework-3.1.0.{name};User ID=sa;Password=Password12!"); return builder.Options; } } diff --git a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderFixture.cs b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderFixture.cs index b441a0c1d..40308bec1 100644 --- a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderFixture.cs +++ b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/DatabaseProviderFixture.cs @@ -7,7 +7,7 @@ using System.Linq; using Microsoft.EntityFrameworkCore; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { /// /// xUnit ClassFixture for creating and deleting integration test databases. diff --git a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/FakeLogger.cs b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/FakeLogger.cs index 9327d0cf6..423885016 100644 --- a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/FakeLogger.cs +++ b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/FakeLogger.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Logging; using System; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { public class FakeLogger : FakeLogger, ILogger { diff --git a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IdentityServer4.EntityFramework.Tests.csproj b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IdentityServer4.EntityFramework.Tests.csproj index dcf5c194c..025057879 100644 --- a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IdentityServer4.EntityFramework.Tests.csproj +++ b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IdentityServer4.EntityFramework.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 false diff --git a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IntegrationTest.cs b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IntegrationTest.cs index 1ab6a7ace..4d6171fb5 100644 --- a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IntegrationTest.cs +++ b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/IntegrationTest.cs @@ -1,11 +1,12 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Xunit; -namespace IdentityServer4.EntityFramework.IntegrationTests +namespace ForgePoint.Identity.EntityFramework.IntegrationTests { /// /// Base class for integration tests, responsible for initializing test database providers & an xUnit class fixture @@ -50,8 +51,16 @@ static IntegrationTest() protected IntegrationTest(DatabaseProviderFixture fixture) { - fixture.Options = TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList(); + fixture.Options = GetTestDatabaseOptions(); fixture.StoreOptions = StoreOptions; } + + protected List> GetTestDatabaseOptions() + { + return TestDatabaseProviders + .Cast() + .Select(row => (DbContextOptions)row[0]) + .ToList(); + } } } \ No newline at end of file diff --git a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/Services/CorsPolicyServiceTests.cs b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/Services/CorsPolicyServiceTests.cs index 12efc5310..2d6bb9333 100644 --- a/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/Services/CorsPolicyServiceTests.cs +++ b/src/EntityFramework/test/IdentityServer4.EntityFramework.Tests/Services/CorsPolicyServiceTests.cs @@ -4,25 +4,25 @@ using System; using System.Collections.Generic; -using IdentityServer4.EntityFramework.DbContexts; -using IdentityServer4.EntityFramework.Mappers; -using IdentityServer4.Models; +using ForgePoint.Identity.EntityFramework.DbContexts; +using ForgePoint.Identity.EntityFramework.Mappers; +using ForgePoint.Identity.Models; using Microsoft.EntityFrameworkCore; using Xunit; using System.Linq; -using IdentityServer4.EntityFramework.Options; +using ForgePoint.Identity.EntityFramework.Options; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.EntityFramework.Interfaces; -using IdentityServer4.EntityFramework.Services; +using ForgePoint.Identity.EntityFramework.Interfaces; +using ForgePoint.Identity.EntityFramework.Services; -namespace IdentityServer4.EntityFramework.IntegrationTests.Services +namespace ForgePoint.Identity.EntityFramework.IntegrationTests.Services { public class CorsPolicyServiceTests : IntegrationTest { public CorsPolicyServiceTests(DatabaseProviderFixture fixture) : base(fixture) { - foreach (var options in TestDatabaseProviders.SelectMany(x => x.Select(y => (DbContextOptions)y)).ToList()) + foreach (var options in GetTestDatabaseOptions()) { using (var context = new ConfigurationDbContext(options, StoreOptions)) context.Database.EnsureCreated(); diff --git a/src/IdentityServer4/build/Program.cs b/src/IdentityServer4/build/Program.cs index 92378de7b..c43549e28 100644 --- a/src/IdentityServer4/build/Program.cs +++ b/src/IdentityServer4/build/Program.cs @@ -2,6 +2,6 @@ { partial class Program { - private const string Prefix = "IdentityServer4"; + private const string Prefix = "ForgePoint.Identity"; } } diff --git a/src/IdentityServer4/build/build.csproj b/src/IdentityServer4/build/build.csproj index 43c81aaed..f1804320d 100644 --- a/src/IdentityServer4/build/build.csproj +++ b/src/IdentityServer4/build/build.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/src/IdentityServer4/host/Configuration/Clients.cs b/src/IdentityServer4/host/Configuration/Clients.cs index 44eb0b421..f3b964a20 100644 --- a/src/IdentityServer4/host/Configuration/Clients.cs +++ b/src/IdentityServer4/host/Configuration/Clients.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; namespace IdentityServerHost.Configuration diff --git a/src/IdentityServer4/host/Configuration/ClientsConsole.cs b/src/IdentityServer4/host/Configuration/ClientsConsole.cs index 0b3dc18da..2cc68ed5f 100644 --- a/src/IdentityServer4/host/Configuration/ClientsConsole.cs +++ b/src/IdentityServer4/host/Configuration/ClientsConsole.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Configuration { diff --git a/src/IdentityServer4/host/Configuration/ClientsWeb.cs b/src/IdentityServer4/host/Configuration/ClientsWeb.cs index 444b887b4..9909da1a3 100644 --- a/src/IdentityServer4/host/Configuration/ClientsWeb.cs +++ b/src/IdentityServer4/host/Configuration/ClientsWeb.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.using System.Collections.Generic; using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Configuration { diff --git a/src/IdentityServer4/host/Configuration/Resources.cs b/src/IdentityServer4/host/Configuration/Resources.cs index 4e0e2df07..ffcf73932 100644 --- a/src/IdentityServer4/host/Configuration/Resources.cs +++ b/src/IdentityServer4/host/Configuration/Resources.cs @@ -3,9 +3,9 @@ using IdentityModel; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; namespace IdentityServerHost.Configuration { diff --git a/src/IdentityServer4/host/Extensions/ExtensionGrantValidator.cs b/src/IdentityServer4/host/Extensions/ExtensionGrantValidator.cs index 04d19a8d7..697385dab 100644 --- a/src/IdentityServer4/host/Extensions/ExtensionGrantValidator.cs +++ b/src/IdentityServer4/host/Extensions/ExtensionGrantValidator.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; namespace IdentityServerHost.Extensions diff --git a/src/IdentityServer4/host/Extensions/HostProfileService.cs b/src/IdentityServer4/host/Extensions/HostProfileService.cs index 070a163ec..97ee25714 100644 --- a/src/IdentityServer4/host/Extensions/HostProfileService.cs +++ b/src/IdentityServer4/host/Extensions/HostProfileService.cs @@ -1,8 +1,8 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Microsoft.Extensions.Logging; namespace IdentityServerHost.Extensions diff --git a/src/IdentityServer4/host/Extensions/NoSubjectExtensionGrantValidator.cs b/src/IdentityServer4/host/Extensions/NoSubjectExtensionGrantValidator.cs index a33cd4f59..eda6e10cd 100644 --- a/src/IdentityServer4/host/Extensions/NoSubjectExtensionGrantValidator.cs +++ b/src/IdentityServer4/host/Extensions/NoSubjectExtensionGrantValidator.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; namespace IdentityServerHost.Extensions diff --git a/src/IdentityServer4/host/Extensions/ParameterizedScopeParser.cs b/src/IdentityServer4/host/Extensions/ParameterizedScopeParser.cs index 2c81e3951..442790dae 100644 --- a/src/IdentityServer4/host/Extensions/ParameterizedScopeParser.cs +++ b/src/IdentityServer4/host/Extensions/ParameterizedScopeParser.cs @@ -1,4 +1,4 @@ -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System; diff --git a/src/IdentityServer4/host/Extensions/ParameterizedScopeTokenRequestValidator.cs b/src/IdentityServer4/host/Extensions/ParameterizedScopeTokenRequestValidator.cs index e4a336fbb..88a3dc4e6 100644 --- a/src/IdentityServer4/host/Extensions/ParameterizedScopeTokenRequestValidator.cs +++ b/src/IdentityServer4/host/Extensions/ParameterizedScopeTokenRequestValidator.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; namespace IdentityServerHost.Extensions { diff --git a/src/IdentityServer4/host/Host.csproj b/src/IdentityServer4/host/Host.csproj index 8d1da5b17..30a02a823 100644 --- a/src/IdentityServer4/host/Host.csproj +++ b/src/IdentityServer4/host/Host.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 InProcess @@ -16,10 +16,10 @@ - + - + diff --git a/src/IdentityServer4/host/LocalApiController.cs b/src/IdentityServer4/host/LocalApiController.cs index c4cef13cd..0d87f4417 100644 --- a/src/IdentityServer4/host/LocalApiController.cs +++ b/src/IdentityServer4/host/LocalApiController.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Linq; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; namespace IdentityServerHost { diff --git a/src/IdentityServer4/host/Program.cs b/src/IdentityServer4/host/Program.cs index 53768a8bc..fbe41fe9b 100644 --- a/src/IdentityServer4/host/Program.cs +++ b/src/IdentityServer4/host/Program.cs @@ -16,7 +16,7 @@ public class Program { public static int Main(string[] args) { - Console.Title = "IdentityServer4"; + Console.Title = "ForgePoint.Identity"; Activity.DefaultIdFormat = ActivityIdFormat.W3C; Log.Logger = new LoggerConfiguration() diff --git a/src/IdentityServer4/host/Quickstart/Account/AccountController.cs b/src/IdentityServer4/host/Quickstart/Account/AccountController.cs index 2d51c3cd0..603872753 100644 --- a/src/IdentityServer4/host/Quickstart/Account/AccountController.cs +++ b/src/IdentityServer4/host/Quickstart/Account/AccountController.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -242,7 +242,7 @@ private async Task BuildLoginViewModelAsync(string returnUrl) var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -344,7 +344,7 @@ private async Task BuildLoggedOutViewModelAsync(string logou if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != ForgePoint.Identity.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/src/IdentityServer4/host/Quickstart/Account/ExternalController.cs b/src/IdentityServer4/host/Quickstart/Account/ExternalController.cs index 1a7479ea1..00c199652 100644 --- a/src/IdentityServer4/host/Quickstart/Account/ExternalController.cs +++ b/src/IdentityServer4/host/Quickstart/Account/ExternalController.cs @@ -1,9 +1,9 @@ using IdentityModel; -using IdentityServer4; -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/src/IdentityServer4/host/Quickstart/Consent/ConsentController.cs b/src/IdentityServer4/host/Quickstart/Consent/ConsentController.cs index 6c3aa44c7..d778e8fb5 100644 --- a/src/IdentityServer4/host/Quickstart/Consent/ConsentController.cs +++ b/src/IdentityServer4/host/Quickstart/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System; @@ -120,7 +120,7 @@ private async Task ProcessConsent(ConsentInputModel model) var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -208,7 +208,7 @@ private ConsentViewModel CreateConsentViewModel( } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -251,7 +251,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/IdentityServer4/host/Quickstart/Consent/ProcessConsentResult.cs b/src/IdentityServer4/host/Quickstart/Consent/ProcessConsentResult.cs index 1d331df04..64ba8c794 100644 --- a/src/IdentityServer4/host/Quickstart/Consent/ProcessConsentResult.cs +++ b/src/IdentityServer4/host/Quickstart/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/IdentityServer4/host/Quickstart/Device/DeviceController.cs b/src/IdentityServer4/host/Quickstart/Device/DeviceController.cs index d7d07aeb9..9ed5ed0f4 100644 --- a/src/IdentityServer4/host/Quickstart/Device/DeviceController.cs +++ b/src/IdentityServer4/host/Quickstart/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -102,7 +102,7 @@ private async Task ProcessConsent(DeviceAuthorizationInput var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -184,7 +184,7 @@ private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, Dev } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -221,7 +221,7 @@ private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = ForgePoint.Identity.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/IdentityServer4/host/Quickstart/Extensions.cs b/src/IdentityServer4/host/Quickstart/Extensions.cs index 6c720b707..60a6ce2bf 100644 --- a/src/IdentityServer4/host/Quickstart/Extensions.cs +++ b/src/IdentityServer4/host/Quickstart/Extensions.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Mvc; namespace IdentityServerHost.Quickstart.UI diff --git a/src/IdentityServer4/host/Quickstart/Grants/GrantsController.cs b/src/IdentityServer4/host/Quickstart/Grants/GrantsController.cs index 128ce5921..195a730de 100644 --- a/src/IdentityServer4/host/Quickstart/Grants/GrantsController.cs +++ b/src/IdentityServer4/host/Quickstart/Grants/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/IdentityServer4/host/Quickstart/Home/ErrorViewModel.cs b/src/IdentityServer4/host/Quickstart/Home/ErrorViewModel.cs index a29a21a94..46b8b7af1 100644 --- a/src/IdentityServer4/host/Quickstart/Home/ErrorViewModel.cs +++ b/src/IdentityServer4/host/Quickstart/Home/ErrorViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/IdentityServer4/host/Quickstart/Home/HomeController.cs b/src/IdentityServer4/host/Quickstart/Home/HomeController.cs index 9cf067895..028af424e 100644 --- a/src/IdentityServer4/host/Quickstart/Home/HomeController.cs +++ b/src/IdentityServer4/host/Quickstart/Home/HomeController.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; diff --git a/src/IdentityServer4/host/Quickstart/TestUsers.cs b/src/IdentityServer4/host/Quickstart/TestUsers.cs index 2acb95405..9f7392e09 100644 --- a/src/IdentityServer4/host/Quickstart/TestUsers.cs +++ b/src/IdentityServer4/host/Quickstart/TestUsers.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; using System.Security.Claims; using System.Text.Json; -using IdentityServer4; +using ForgePoint.Identity; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/IdentityServer4/host/Startup.cs b/src/IdentityServer4/host/Startup.cs index f4390b6eb..2dbab7eab 100644 --- a/src/IdentityServer4/host/Startup.cs +++ b/src/IdentityServer4/host/Startup.cs @@ -5,7 +5,7 @@ using System; using IdentityServerHost.Configuration; using IdentityModel; -using IdentityServer4; +using ForgePoint.Identity; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -97,6 +97,9 @@ public void ConfigureServices(IServiceCollection services) return Task.FromResult(principal); }); + + services.AddHealthChecks() + .AddIdentityServer(); } public void Configure(IApplicationBuilder app) @@ -125,6 +128,7 @@ public void Configure(IApplicationBuilder app) app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); + endpoints.MapHealthChecks("/health"); }); } } diff --git a/src/IdentityServer4/host/Views/Home/Index.cshtml b/src/IdentityServer4/host/Views/Home/Index.cshtml index e0fb30c1e..7dc2e1544 100644 --- a/src/IdentityServer4/host/Views/Home/Index.cshtml +++ b/src/IdentityServer4/host/Views/Home/Index.cshtml @@ -2,13 +2,13 @@ @using System.Reflection @{ - var version = typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.GetCustomAttribute()?.InformationalVersion.Split('+').First(); + var version = typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.GetCustomAttribute()?.InformationalVersion.Split('+').First(); }

    - Welcome to IdentityServer4 + Welcome to ForgePoint.Identity (version @version)

    @@ -26,8 +26,8 @@
  • Here are links to the - source code repository, - and ready to use samples. + source code repository, + and ready to use samples.
  • diff --git a/src/IdentityServer4/host/Views/Shared/_Layout.cshtml b/src/IdentityServer4/host/Views/Shared/_Layout.cshtml index 35605f440..402036f0e 100644 --- a/src/IdentityServer4/host/Views/Shared/_Layout.cshtml +++ b/src/IdentityServer4/host/Views/Shared/_Layout.cshtml @@ -5,7 +5,7 @@ - IdentityServer4 + ForgePoint.Identity diff --git a/src/IdentityServer4/host/Views/Shared/_Nav.cshtml b/src/IdentityServer4/host/Views/Shared/_Nav.cshtml index 6ab6b702c..1b3e47536 100644 --- a/src/IdentityServer4/host/Views/Shared/_Nav.cshtml +++ b/src/IdentityServer4/host/Views/Shared/_Nav.cshtml @@ -1,4 +1,4 @@ -@using IdentityServer4.Extensions +@using ForgePoint.Identity.Extensions @{ string name = null; @@ -13,7 +13,7 @@ - IdentityServer4 + ForgePoint.Identity @if (!string.IsNullOrWhiteSpace(name)) diff --git a/src/IdentityServer4/src/Configuration/CryptoHelper.cs b/src/IdentityServer4/src/Configuration/CryptoHelper.cs index 0894fd744..b54f21efe 100644 --- a/src/IdentityServer4/src/Configuration/CryptoHelper.cs +++ b/src/IdentityServer4/src/Configuration/CryptoHelper.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Crypto helper diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Additional.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Additional.cs index 08547e333..774f5642c 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Additional.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Additional.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.DependencyInjection.Extensions; using System; using System.Net.Http; -using IdentityServer4; -using IdentityServer4.Configuration; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.Logging; namespace Microsoft.Extensions.DependencyInjection @@ -451,7 +451,7 @@ public static IIdentityServerBuilder AddUserSession(this IIdentityServerBuild where T : class, IUserSession { // This is added as scoped due to the note regarding the AuthenticateAsync - // method in the IdentityServer4.Services.DefaultUserSession implementation. + // method in the ForgePoint.Identity.Services.DefaultUserSession implementation. builder.Services.AddScoped(); return builder; diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Core.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Core.cs index 2f9fd16b6..0fbb41b8b 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Core.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Core.cs @@ -2,30 +2,30 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Configuration.DependencyInjection; -using IdentityServer4.Endpoints; -using IdentityServer4.Events; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Configuration.DependencyInjection; +using ForgePoint.Identity.Endpoints; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using System; using System.Linq; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication; -using static IdentityServer4.Constants; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting.FederatedSignOut; -using IdentityServer4.Services.Default; +using static ForgePoint.Identity.Constants; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting.FederatedSignOut; +using ForgePoint.Identity.Services.Default; namespace Microsoft.Extensions.DependencyInjection { @@ -46,6 +46,8 @@ public static IIdentityServerBuilder AddRequiredPlatformServices(this IIdentityS builder.Services.AddSingleton( resolver => resolver.GetRequiredService>().Value); builder.Services.AddHttpClient(); + builder.Services.TryAddSingleton(TimeProvider.System); + builder.Services.TryAddSingleton(); return builder; } @@ -90,6 +92,7 @@ public static IIdentityServerBuilder AddDefaultEndpoints(this IIdentityServerBui builder.AddEndpoint(EndpointNames.Revocation, ProtocolRoutePaths.Revocation.EnsureLeadingSlash()); builder.AddEndpoint(EndpointNames.Token, ProtocolRoutePaths.Token.EnsureLeadingSlash()); builder.AddEndpoint(EndpointNames.UserInfo, ProtocolRoutePaths.UserInfo.EnsureLeadingSlash()); + builder.AddEndpoint(EndpointNames.PushedAuthorization, ProtocolRoutePaths.PushedAuthorization.EnsureLeadingSlash()); return builder; } @@ -106,7 +109,7 @@ public static IIdentityServerBuilder AddEndpoint(this IIdentityServerBuilder where T : class, IEndpointHandler { builder.Services.AddTransient(); - builder.Services.AddSingleton(new IdentityServer4.Hosting.Endpoint(name, path, typeof(T))); + builder.Services.AddSingleton(new ForgePoint.Identity.Hosting.Endpoint(name, path, typeof(T))); return builder; } @@ -174,6 +177,7 @@ public static IIdentityServerBuilder AddPluggableServices(this IIdentityServerBu builder.Services.TryAddTransient(); builder.Services.TryAddTransient(); builder.Services.TryAddTransient(); + builder.Services.TryAddTransient(); builder.AddJwtRequestUriHttpClient(); builder.AddBackChannelLogoutHttpClient(); diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Crypto.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Crypto.cs index 381efc0a4..3ae5ae8e2 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Crypto.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Crypto.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using System; diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/HealthChecks.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/HealthChecks.cs new file mode 100644 index 000000000..5b3861201 --- /dev/null +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/HealthChecks.cs @@ -0,0 +1,28 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using ForgePoint.Identity.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace Microsoft.Extensions.DependencyInjection +{ + /// + /// Health check registration helpers for IdentityServer. + /// + public static class IdentityServerHealthCheckBuilderExtensions + { + /// + /// Adds a health check that verifies IdentityServer signing material is available. + /// + /// The health checks builder. + /// The health check name. Defaults to "identityserver". + /// Optional tags. + /// The health checks builder. + public static IHealthChecksBuilder AddIdentityServer(this IHealthChecksBuilder builder, string name = "identityserver", params string[] tags) + { + return builder.AddCheck(name, tags: tags); + } + } +} diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/InMemory.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/InMemory.cs index e0b6550ba..d17482b04 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/InMemory.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/InMemory.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.DependencyInjection.Extensions; using System.Collections.Generic; diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureInternalCookieOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureInternalCookieOptions.cs index 94c5a8998..d60083392 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureInternalCookieOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureInternalCookieOptions.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { internal class ConfigureInternalCookieOptions : IConfigureNamedOptions { @@ -83,7 +83,7 @@ public PostConfigureInternalCookieOptions( { _idsrv = idsrv; _authOptions = authOptions; - _logger = loggerFactory.CreateLogger("IdentityServer4.Startup"); + _logger = loggerFactory.CreateLogger("ForgePoint.Identity.Startup"); } public void PostConfigure(string name, CookieAuthenticationOptions options) diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureOpenIdConnectOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureOpenIdConnectOptions.cs index 7155257da..fd99c88de 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureOpenIdConnectOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/ConfigureOpenIdConnectOptions.cs @@ -4,12 +4,12 @@ using System; using System.Linq; -using IdentityServer4.Infrastructure; +using ForgePoint.Identity.Infrastructure; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Options; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { internal class ConfigureOpenIdConnectOptions : IPostConfigureOptions { diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Decorator.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Decorator.cs index ac30439dc..6969d46db 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Decorator.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Decorator.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.Configuration.DependencyInjection +namespace ForgePoint.Identity.Configuration.DependencyInjection { internal class Decorator { diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerBuilder.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerBuilder.cs index ba0c7d114..845d5bbea 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerBuilder.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerBuilder.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using System; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// IdentityServer helper class for DI configuration diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerServiceCollectionExtensions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerServiceCollectionExtensions.cs index a4f292b1d..8ef79b514 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerServiceCollectionExtensions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/IdentityServerServiceCollectionExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.Configuration; using System; using Microsoft.AspNetCore.Http; diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/AuthenticationOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/AuthenticationOptions.cs index c77aff4ff..4cee58e92 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/AuthenticationOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/AuthenticationOptions.cs @@ -5,7 +5,7 @@ using System; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Configures the login and logout views and behavior. diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CachingOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CachingOptions.cs index ff50c3d9e..856eef003 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CachingOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CachingOptions.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Caching options. diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CorsOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CorsOptions.cs index 2f2bdc92f..de32f8cd0 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CorsOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CorsOptions.cs @@ -2,13 +2,13 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Options for CORS diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CspOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CspOptions.cs index c272d8214..215106929 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CspOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/CspOptions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Options for Content Security Policy diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DeviceFlowOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DeviceFlowOptions.cs index caf22da81..f616e3cf7 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DeviceFlowOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DeviceFlowOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Configures device flow diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DiscoveryOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DiscoveryOptions.cs index f57e49d59..9ebffc841 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DiscoveryOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/DiscoveryOptions.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Options class to configure discovery endpoint diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EndpointOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EndpointOptions.cs index 4c8782d81..d36e31c6f 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EndpointOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EndpointOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Configures which endpoints are enabled or disabled. @@ -85,5 +85,13 @@ public class EndpointsOptions /// true if the device authorization endpoint is enabled; otherwise, false. /// public bool EnableDeviceAuthorizationEndpoint { get; set; } = true; + + /// + /// Gets or sets a value indicating whether the pushed authorization endpoint is enabled. + /// + /// + /// true if the pushed authorization endpoint is enabled; otherwise, false. + /// + public bool EnablePushedAuthorizationEndpoint { get; set; } = true; } } \ No newline at end of file diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EventsOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EventsOptions.cs index f810b233e..832d7f46a 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EventsOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/EventsOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Configures events diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs index e88a15d1b..1a67c8f77 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/IdentityServerOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// The IdentityServerOptions class is the top level container for all configuration settings of IdentityServer. @@ -125,6 +125,11 @@ public class IdentityServerOptions /// Gets or sets the device flow options. /// public DeviceFlowOptions DeviceFlow { get; set; } = new DeviceFlowOptions(); + + /// + /// Gets or sets the pushed authorization request options (RFC 9126). + /// + public PushedAuthorizationOptions PushedAuthorization { get; set; } = new PushedAuthorizationOptions(); /// /// Gets or sets the logging options diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/InputLengthRestrictions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/InputLengthRestrictions.cs index f11278c0f..c45ab6dea 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/InputLengthRestrictions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/InputLengthRestrictions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/LoggingOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/LoggingOptions.cs index ad6c02be9..71acc5ea0 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/LoggingOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/LoggingOptions.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using IdentityModel; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Options for configuring logging behavior diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/MtlsOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/MtlsOptions.cs index 519b6bf5a..a441ca4e0 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/MtlsOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/MtlsOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Options for Mutual TLS features diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/PushedAuthorizationOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/PushedAuthorizationOptions.cs new file mode 100644 index 000000000..c123194ee --- /dev/null +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/PushedAuthorizationOptions.cs @@ -0,0 +1,22 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +namespace ForgePoint.Identity.Configuration +{ + /// + /// Options for OAuth 2.0 Pushed Authorization Requests (RFC 9126). + /// + public class PushedAuthorizationOptions + { + /// + /// Lifetime of a pushed authorization request in seconds. Defaults to 60. + /// + public int Lifetime { get; set; } = 60; + + /// + /// When true, every client must use pushed authorization requests. Defaults to false. + /// + public bool Required { get; set; } = false; + } +} diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/UserInteractionOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/UserInteractionOptions.cs index e87580a1e..ba7ed225c 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/UserInteractionOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/UserInteractionOptions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// Options for aspects of the user interface. diff --git a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/ValidationOptions.cs b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/ValidationOptions.cs index 3781acda4..e50682ca2 100644 --- a/src/IdentityServer4/src/Configuration/DependencyInjection/Options/ValidationOptions.cs +++ b/src/IdentityServer4/src/Configuration/DependencyInjection/Options/ValidationOptions.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Configuration +namespace ForgePoint.Identity.Configuration { /// /// The ValidationOptions contains settings that affect some of the default validation behavior. diff --git a/src/IdentityServer4/src/Configuration/IdentityServerApplicationBuilderExtensions.cs b/src/IdentityServer4/src/Configuration/IdentityServerApplicationBuilderExtensions.cs index c20b776ba..569578730 100644 --- a/src/IdentityServer4/src/Configuration/IdentityServerApplicationBuilderExtensions.cs +++ b/src/IdentityServer4/src/Configuration/IdentityServerApplicationBuilderExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -54,8 +54,8 @@ internal static void Validate(this IApplicationBuilder app) var loggerFactory = app.ApplicationServices.GetService(typeof(ILoggerFactory)) as ILoggerFactory; if (loggerFactory == null) throw new ArgumentNullException(nameof(loggerFactory)); - var logger = loggerFactory.CreateLogger("IdentityServer4.Startup"); - logger.LogInformation("Starting IdentityServer4 version {version}", typeof(IdentityServer4.Hosting.IdentityServerMiddleware).Assembly.GetCustomAttribute().InformationalVersion); + var logger = loggerFactory.CreateLogger("ForgePoint.Identity.Startup"); + logger.LogInformation("Starting ForgePoint.Identity version {version}", typeof(ForgePoint.Identity.Hosting.IdentityServerMiddleware).Assembly.GetCustomAttribute().InformationalVersion); var scopeFactory = app.ApplicationServices.GetService(); diff --git a/src/IdentityServer4/src/Constants.cs b/src/IdentityServer4/src/Constants.cs index 7cf040c12..e8fd6a563 100644 --- a/src/IdentityServer4/src/Constants.cs +++ b/src/IdentityServer4/src/Constants.cs @@ -3,18 +3,19 @@ using IdentityModel; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System; using System.Collections.Generic; -namespace IdentityServer4 +namespace ForgePoint.Identity { internal static class Constants { - public const string IdentityServerName = "IdentityServer4"; + public const string IdentityServerName = "ForgePoint.Identity"; public const string IdentityServerAuthenticationType = IdentityServerName; public const string ExternalAuthenticationMethod = "external"; public const string DefaultHashAlgorithm = "SHA256"; + public const string PushedAuthorizationRequestUriPrefix = "urn:ietf:params:oauth:request_uri:"; public static readonly TimeSpan DefaultCookieTimeSpan = TimeSpan.FromHours(10); public static readonly TimeSpan DefaultCacheDuration = TimeSpan.FromMinutes(60); @@ -205,6 +206,7 @@ public static class EndpointNames public const string EndSession = "Endsession"; public const string CheckSession = "Checksession"; public const string UserInfo = "Userinfo"; + public const string PushedAuthorization = "PushedAuthorization"; } public static class ProtocolRoutePaths @@ -223,6 +225,7 @@ public static class ProtocolRoutePaths public const string EndSessionCallback = EndSession + "/callback"; public const string CheckSession = ConnectPathPrefix + "/checksession"; public const string DeviceAuthorization = ConnectPathPrefix + "/deviceauthorization"; + public const string PushedAuthorization = ConnectPathPrefix + "/par"; public const string MtlsPathPrefix = ConnectPathPrefix + "/mtls"; public const string MtlsToken = MtlsPathPrefix + "/token"; @@ -236,7 +239,8 @@ public static class ProtocolRoutePaths DiscoveryWebKeys, Token, UserInfo, - Revocation + Revocation, + PushedAuthorization }; } diff --git a/src/IdentityServer4/src/Endpoints/AuthorizeCallbackEndpoint.cs b/src/IdentityServer4/src/Endpoints/AuthorizeCallbackEndpoint.cs index baf4e603f..10c0ea5dd 100644 --- a/src/IdentityServer4/src/Endpoints/AuthorizeCallbackEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/AuthorizeCallbackEndpoint.cs @@ -4,19 +4,19 @@ using System.Collections.Specialized; using System.Net; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class AuthorizeCallbackEndpoint : AuthorizeEndpointBase { diff --git a/src/IdentityServer4/src/Endpoints/AuthorizeEndpoint.cs b/src/IdentityServer4/src/Endpoints/AuthorizeEndpoint.cs index e01aa3fe8..bd51787ea 100644 --- a/src/IdentityServer4/src/Endpoints/AuthorizeEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/AuthorizeEndpoint.cs @@ -4,17 +4,17 @@ using System.Collections.Specialized; using System.Net; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class AuthorizeEndpoint : AuthorizeEndpointBase { diff --git a/src/IdentityServer4/src/Endpoints/AuthorizeEndpointBase.cs b/src/IdentityServer4/src/Endpoints/AuthorizeEndpointBase.cs index dad027c38..710007f32 100644 --- a/src/IdentityServer4/src/Endpoints/AuthorizeEndpointBase.cs +++ b/src/IdentityServer4/src/Endpoints/AuthorizeEndpointBase.cs @@ -6,20 +6,20 @@ using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.Logging.Models; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Logging.Models; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal abstract class AuthorizeEndpointBase : IEndpointHandler { diff --git a/src/IdentityServer4/src/Endpoints/CheckSessionEndpoint.cs b/src/IdentityServer4/src/Endpoints/CheckSessionEndpoint.cs index 1e2345553..1f9640567 100644 --- a/src/IdentityServer4/src/Endpoints/CheckSessionEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/CheckSessionEndpoint.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System.Net; using System.Threading.Tasks; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class CheckSessionEndpoint : IEndpointHandler { diff --git a/src/IdentityServer4/src/Endpoints/DeviceAuthorizationEndpoint.cs b/src/IdentityServer4/src/Endpoints/DeviceAuthorizationEndpoint.cs index 3d93cac40..96e49a0bd 100644 --- a/src/IdentityServer4/src/Endpoints/DeviceAuthorizationEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/DeviceAuthorizationEndpoint.cs @@ -5,22 +5,22 @@ using System.Collections.Generic; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { /// /// The device authorization endpoint /// - /// + /// internal class DeviceAuthorizationEndpoint : IEndpointHandler { private readonly IClientSecretValidator _clientValidator; diff --git a/src/IdentityServer4/src/Endpoints/DiscoveryEndpoint.cs b/src/IdentityServer4/src/Endpoints/DiscoveryEndpoint.cs index e11481e8e..3591599a9 100644 --- a/src/IdentityServer4/src/Endpoints/DiscoveryEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/DiscoveryEndpoint.cs @@ -3,15 +3,15 @@ using System.Net; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class DiscoveryEndpoint : IEndpointHandler { diff --git a/src/IdentityServer4/src/Endpoints/DiscoveryKeyEndpoint.cs b/src/IdentityServer4/src/Endpoints/DiscoveryKeyEndpoint.cs index b576957ba..7287b4cc9 100644 --- a/src/IdentityServer4/src/Endpoints/DiscoveryKeyEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/DiscoveryKeyEndpoint.cs @@ -3,14 +3,14 @@ using System.Net; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class DiscoveryKeyEndpoint : IEndpointHandler { diff --git a/src/IdentityServer4/src/Endpoints/EndSessionCallbackEndpoint.cs b/src/IdentityServer4/src/Endpoints/EndSessionCallbackEndpoint.cs index 736ee41ab..887924590 100644 --- a/src/IdentityServer4/src/Endpoints/EndSessionCallbackEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/EndSessionCallbackEndpoint.cs @@ -3,14 +3,14 @@ using System.Net; using System.Threading.Tasks; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.Validation; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class EndSessionCallbackEndpoint : IEndpointHandler { diff --git a/src/IdentityServer4/src/Endpoints/EndSessionEndpoint.cs b/src/IdentityServer4/src/Endpoints/EndSessionEndpoint.cs index 97dfa4d5a..672ba301f 100644 --- a/src/IdentityServer4/src/Endpoints/EndSessionEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/EndSessionEndpoint.cs @@ -4,15 +4,15 @@ using System.Collections.Specialized; using System.Net; using System.Threading.Tasks; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { internal class EndSessionEndpoint : IEndpointHandler { diff --git a/src/IdentityServer4/src/Endpoints/IntrospectionEndpoint.cs b/src/IdentityServer4/src/Endpoints/IntrospectionEndpoint.cs index d13b5fdd9..e00e1a7e8 100644 --- a/src/IdentityServer4/src/Endpoints/IntrospectionEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/IntrospectionEndpoint.cs @@ -3,23 +3,23 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Validation; +using ForgePoint.Identity.ResponseHandling; using Microsoft.Extensions.Logging; -using IdentityServer4.Hosting; -using IdentityServer4.Endpoints.Results; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Endpoints.Results; using Microsoft.AspNetCore.Http; using System.Net; -using IdentityServer4.Services; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { /// /// Introspection endpoint /// - /// + /// internal class IntrospectionEndpoint : IEndpointHandler { private readonly IIntrospectionResponseGenerator _responseGenerator; diff --git a/src/IdentityServer4/src/Endpoints/PushedAuthorizationEndpoint.cs b/src/IdentityServer4/src/Endpoints/PushedAuthorizationEndpoint.cs new file mode 100644 index 000000000..7855fdd40 --- /dev/null +++ b/src/IdentityServer4/src/Endpoints/PushedAuthorizationEndpoint.cs @@ -0,0 +1,110 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Collections.Generic; +using System.Threading.Tasks; +using IdentityModel; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; + +namespace ForgePoint.Identity.Endpoints +{ + /// + /// OAuth 2.0 Pushed Authorization Request endpoint (RFC 9126). + /// + internal class PushedAuthorizationEndpoint : IEndpointHandler + { + private readonly IClientSecretValidator _clientValidator; + private readonly IPushedAuthorizationStore _store; + private readonly IdentityServerOptions _options; + private readonly ILogger _logger; + + public PushedAuthorizationEndpoint( + IClientSecretValidator clientValidator, + IPushedAuthorizationStore store, + IdentityServerOptions options, + ILogger logger) + { + _clientValidator = clientValidator; + _store = store; + _options = options; + _logger = logger; + } + + public async Task ProcessAsync(HttpContext context) + { + _logger.LogDebug("Start pushed authorization request."); + + if (!HttpMethods.IsPost(context.Request.Method) || !context.Request.HasApplicationFormContentType()) + { + _logger.LogWarning("Invalid HTTP request for PAR endpoint"); + return Error(OidcConstants.AuthorizeErrors.InvalidRequest, "Invalid HTTP request"); + } + + var clientResult = await _clientValidator.ValidateAsync(context); + if (clientResult.Client == null) + { + return Error(OidcConstants.TokenErrors.InvalidClient, "Invalid client"); + } + + var form = (await context.Request.ReadFormAsync()).AsNameValueCollection(); + + if (form.Get(OidcConstants.AuthorizeRequest.RequestUri).IsPresent()) + { + _logger.LogError("request_uri is not allowed at the PAR endpoint"); + return Error(OidcConstants.AuthorizeErrors.InvalidRequest, "request_uri is not allowed at the PAR endpoint"); + } + + var clientId = form.Get(OidcConstants.AuthorizeRequest.ClientId); + if (clientId.IsPresent() && clientId != clientResult.Client.ClientId) + { + _logger.LogError("client_id in body does not match authenticated client"); + return Error(OidcConstants.AuthorizeErrors.InvalidRequest, "client_id does not match authenticated client"); + } + + if (clientId.IsMissing()) + { + form[OidcConstants.AuthorizeRequest.ClientId] = clientResult.Client.ClientId; + } + + // never persist the client secret with the authorization request + form.Remove("client_secret"); + + var parameters = new Dictionary(); + foreach (var key in form.AllKeys) + { + if (key != null) + { + parameters[key] = form[key]; + } + } + + var requestUri = await _store.StoreAsync(new PushedAuthorizationRequest + { + ClientId = clientResult.Client.ClientId, + Parameters = parameters + }); + + _logger.LogDebug("Issued pushed authorization request_uri for client {clientId}", clientResult.Client.ClientId); + + return new PushedAuthorizationResult(requestUri, _options.PushedAuthorization.Lifetime); + } + + private TokenErrorResult Error(string error, string errorDescription = null) + { + return new TokenErrorResult(new ResponseHandling.TokenErrorResponse + { + Error = error, + ErrorDescription = errorDescription + }); + } + } +} diff --git a/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs b/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs index bb1748cab..347d8d554 100644 --- a/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs @@ -3,21 +3,22 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; using IdentityModel; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using System; -using IdentityServer4.Services; -using IdentityServer4.Configuration; -using IdentityServer4.Stores; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.ResponseHandling; using Microsoft.AspNetCore.Authentication; using System.Text.Encodings.Web; +using ForgePoint.Identity; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class AuthorizeResult : IEndpointResult { @@ -33,7 +34,7 @@ internal AuthorizeResult( IdentityServerOptions options, IUserSession userSession, IMessageStore errorMessageStore, - ISystemClock clock) + IClock clock) : this(response) { _options = options; @@ -45,14 +46,14 @@ internal AuthorizeResult( private IdentityServerOptions _options; private IUserSession _userSession; private IMessageStore _errorMessageStore; - private ISystemClock _clock; + private IClock _clock; private void Init(HttpContext context) { _options = _options ?? context.RequestServices.GetRequiredService(); _userSession = _userSession ?? context.RequestServices.GetRequiredService(); _errorMessageStore = _errorMessageStore ?? context.RequestServices.GetRequiredService>(); - _clock = _clock ?? context.RequestServices.GetRequiredService(); + _clock = _clock ?? context.RequestServices.GetRequiredService(); } public async Task ExecuteAsync(HttpContext context) diff --git a/src/IdentityServer4/src/Endpoints/Results/BadRequestResult.cs b/src/IdentityServer4/src/Endpoints/Results/BadRequestResult.cs index 2c7730c52..a449764a0 100644 --- a/src/IdentityServer4/src/Endpoints/Results/BadRequestResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/BadRequestResult.cs @@ -3,11 +3,11 @@ using System.Threading.Tasks; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class BadRequestResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/CheckSessionResult.cs b/src/IdentityServer4/src/Endpoints/Results/CheckSessionResult.cs index 769d652d2..4279eb72b 100644 --- a/src/IdentityServer4/src/Endpoints/Results/CheckSessionResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/CheckSessionResult.cs @@ -3,13 +3,13 @@ using System.Threading.Tasks; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class CheckSessionResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/ConsentPageResult.cs b/src/IdentityServer4/src/Endpoints/Results/ConsentPageResult.cs index a78dcec3d..492dd9e26 100644 --- a/src/IdentityServer4/src/Endpoints/Results/ConsentPageResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/ConsentPageResult.cs @@ -5,21 +5,21 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; -using IdentityServer4.Validation; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Validation; +using ForgePoint.Identity.Extensions; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.Stores; -using IdentityServer4.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for consent page /// - /// + /// public class ConsentPageResult : IEndpointResult { private readonly ValidatedAuthorizeRequest _request; diff --git a/src/IdentityServer4/src/Endpoints/Results/CustomRedirectResult.cs b/src/IdentityServer4/src/Endpoints/Results/CustomRedirectResult.cs index 6bb49438b..f60e7ab00 100644 --- a/src/IdentityServer4/src/Endpoints/Results/CustomRedirectResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/CustomRedirectResult.cs @@ -4,19 +4,19 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Hosting; -using IdentityServer4.Validation; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; -using IdentityServer4.Extensions; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for a custom redirect /// - /// + /// public class CustomRedirectResult : IEndpointResult { private readonly ValidatedAuthorizeRequest _request; diff --git a/src/IdentityServer4/src/Endpoints/Results/DeviceAuthorizationResult.cs b/src/IdentityServer4/src/Endpoints/Results/DeviceAuthorizationResult.cs index 7918bf5ff..ae17e5d8f 100644 --- a/src/IdentityServer4/src/Endpoints/Results/DeviceAuthorizationResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/DeviceAuthorizationResult.cs @@ -4,12 +4,12 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class DeviceAuthorizationResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/DiscoveryDocumentResult.cs b/src/IdentityServer4/src/Endpoints/Results/DiscoveryDocumentResult.cs index 6660baf86..8bed8b016 100644 --- a/src/IdentityServer4/src/Endpoints/Results/DiscoveryDocumentResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/DiscoveryDocumentResult.cs @@ -2,19 +2,19 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for a discovery document /// - /// + /// public class DiscoveryDocumentResult : IEndpointResult { /// diff --git a/src/IdentityServer4/src/Endpoints/Results/EndSessionCallbackResult.cs b/src/IdentityServer4/src/Endpoints/Results/EndSessionCallbackResult.cs index f5baf5d2b..63ab748cf 100644 --- a/src/IdentityServer4/src/Endpoints/Results/EndSessionCallbackResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/EndSessionCallbackResult.cs @@ -3,18 +3,18 @@ using System.Linq; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using System.Net; using System; -using IdentityServer4.Extensions; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Configuration; using System.Text.Encodings.Web; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class EndSessionCallbackResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/EndSessionResult.cs b/src/IdentityServer4/src/Endpoints/Results/EndSessionResult.cs index c48698870..69640c5a6 100644 --- a/src/IdentityServer4/src/Endpoints/Results/EndSessionResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/EndSessionResult.cs @@ -3,23 +3,24 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Validation; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Extensions; using System; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for endsession /// - /// + /// public class EndSessionResult : IEndpointResult { private readonly EndSessionValidationResult _result; @@ -37,7 +38,7 @@ public EndSessionResult(EndSessionValidationResult result) internal EndSessionResult( EndSessionValidationResult result, IdentityServerOptions options, - ISystemClock clock, + IClock clock, IMessageStore logoutMessageStore) : this(result) { @@ -47,13 +48,13 @@ internal EndSessionResult( } private IdentityServerOptions _options; - private ISystemClock _clock; + private IClock _clock; private IMessageStore _logoutMessageStore; private void Init(HttpContext context) { _options = _options ?? context.RequestServices.GetRequiredService(); - _clock = _clock ?? context.RequestServices.GetRequiredService(); + _clock = _clock ?? context.RequestServices.GetRequiredService(); _logoutMessageStore = _logoutMessageStore ?? context.RequestServices.GetRequiredService>(); } diff --git a/src/IdentityServer4/src/Endpoints/Results/IntrospectionResult.cs b/src/IdentityServer4/src/Endpoints/Results/IntrospectionResult.cs index 0f278757b..f5f1ad425 100644 --- a/src/IdentityServer4/src/Endpoints/Results/IntrospectionResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/IntrospectionResult.cs @@ -4,17 +4,17 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using System; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for introspection /// - /// + /// public class IntrospectionResult : IEndpointResult { /// diff --git a/src/IdentityServer4/src/Endpoints/Results/JsonWebKeysResult.cs b/src/IdentityServer4/src/Endpoints/Results/JsonWebKeysResult.cs index 5cf48e306..b5691a798 100644 --- a/src/IdentityServer4/src/Endpoints/Results/JsonWebKeysResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/JsonWebKeysResult.cs @@ -2,20 +2,20 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for the jwks document /// - /// + /// public class JsonWebKeysResult : IEndpointResult { /// diff --git a/src/IdentityServer4/src/Endpoints/Results/LoginPageResult.cs b/src/IdentityServer4/src/Endpoints/Results/LoginPageResult.cs index 876bf080e..b7e872921 100644 --- a/src/IdentityServer4/src/Endpoints/Results/LoginPageResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/LoginPageResult.cs @@ -5,21 +5,21 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Hosting; -using IdentityServer4.Validation; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; -using IdentityServer4.Extensions; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.Stores; -using IdentityServer4.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for login page /// - /// + /// public class LoginPageResult : IEndpointResult { private readonly ValidatedAuthorizeRequest _request; diff --git a/src/IdentityServer4/src/Endpoints/Results/ProtectedResourceErrorResult.cs b/src/IdentityServer4/src/Endpoints/Results/ProtectedResourceErrorResult.cs index f32c9f3b2..12ae147b5 100644 --- a/src/IdentityServer4/src/Endpoints/Results/ProtectedResourceErrorResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/ProtectedResourceErrorResult.cs @@ -3,14 +3,14 @@ using System.Threading.Tasks; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.Extensions.Primitives; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; using IdentityModel; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class ProtectedResourceErrorResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/PushedAuthorizationResult.cs b/src/IdentityServer4/src/Endpoints/Results/PushedAuthorizationResult.cs new file mode 100644 index 000000000..7b4707b83 --- /dev/null +++ b/src/IdentityServer4/src/Endpoints/Results/PushedAuthorizationResult.cs @@ -0,0 +1,43 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System; +using System.Net; +using System.Threading.Tasks; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using Microsoft.AspNetCore.Http; + +namespace ForgePoint.Identity.Endpoints.Results +{ + internal class PushedAuthorizationResult : IEndpointResult + { + public string RequestUri { get; } + public int ExpiresIn { get; } + + public PushedAuthorizationResult(string requestUri, int expiresIn) + { + RequestUri = requestUri ?? throw new ArgumentNullException(nameof(requestUri)); + ExpiresIn = expiresIn; + } + + public async Task ExecuteAsync(HttpContext context) + { + context.Response.StatusCode = (int)HttpStatusCode.Created; + context.Response.SetNoCache(); + + await context.Response.WriteJsonAsync(new ResultDto + { + request_uri = RequestUri, + expires_in = ExpiresIn + }); + } + + internal class ResultDto + { + public string request_uri { get; set; } + public int expires_in { get; set; } + } + } +} diff --git a/src/IdentityServer4/src/Endpoints/Results/StatusCodeResult.cs b/src/IdentityServer4/src/Endpoints/Results/StatusCodeResult.cs index d7ae37cf9..40e9a6e8c 100644 --- a/src/IdentityServer4/src/Endpoints/Results/StatusCodeResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/StatusCodeResult.cs @@ -4,15 +4,15 @@ using System.Threading.Tasks; using System.Net; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for a raw HTTP status code /// - /// + /// public class StatusCodeResult : IEndpointResult { /// diff --git a/src/IdentityServer4/src/Endpoints/Results/TokenErrorResult.cs b/src/IdentityServer4/src/Endpoints/Results/TokenErrorResult.cs index af139d41c..5755d7f2f 100644 --- a/src/IdentityServer4/src/Endpoints/Results/TokenErrorResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/TokenErrorResult.cs @@ -3,15 +3,15 @@ using System.Threading.Tasks; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Text.Json.Serialization; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.ResponseHandling; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class TokenErrorResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/TokenResult.cs b/src/IdentityServer4/src/Endpoints/Results/TokenResult.cs index a2c70d035..edb4a5c5c 100644 --- a/src/IdentityServer4/src/Endpoints/Results/TokenResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/TokenResult.cs @@ -3,16 +3,16 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class TokenResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/Results/TokenRevocationErrorResult.cs b/src/IdentityServer4/src/Endpoints/Results/TokenRevocationErrorResult.cs index 35c68ab9a..80146b298 100644 --- a/src/IdentityServer4/src/Endpoints/Results/TokenRevocationErrorResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/TokenRevocationErrorResult.cs @@ -2,18 +2,18 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using System.Net; using System.Threading.Tasks; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { /// /// Result for revocation error /// - /// + /// public class TokenRevocationErrorResult : IEndpointResult { /// diff --git a/src/IdentityServer4/src/Endpoints/Results/UserInfoResult.cs b/src/IdentityServer4/src/Endpoints/Results/UserInfoResult.cs index 4042afe44..fcaeae4c0 100644 --- a/src/IdentityServer4/src/Endpoints/Results/UserInfoResult.cs +++ b/src/IdentityServer4/src/Endpoints/Results/UserInfoResult.cs @@ -4,11 +4,11 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Endpoints.Results +namespace ForgePoint.Identity.Endpoints.Results { internal class UserInfoResult : IEndpointResult { diff --git a/src/IdentityServer4/src/Endpoints/TokenEndpoint.cs b/src/IdentityServer4/src/Endpoints/TokenEndpoint.cs index 6a9b9ffec..f06c21c34 100644 --- a/src/IdentityServer4/src/Endpoints/TokenEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/TokenEndpoint.cs @@ -3,24 +3,24 @@ using IdentityModel; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { /// /// The token endpoint /// - /// + /// internal class TokenEndpoint : IEndpointHandler { private readonly IClientSecretValidator _clientValidator; diff --git a/src/IdentityServer4/src/Endpoints/TokenRevocationEndpoint.cs b/src/IdentityServer4/src/Endpoints/TokenRevocationEndpoint.cs index b50c2291a..bff2ec1c2 100644 --- a/src/IdentityServer4/src/Endpoints/TokenRevocationEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/TokenRevocationEndpoint.cs @@ -3,24 +3,24 @@ using IdentityModel; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Hosting; -using IdentityServer4.Validation; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System.Net; using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Http; -using IdentityServer4.Events; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { /// /// The revocation endpoint /// - /// + /// internal class TokenRevocationEndpoint : IEndpointHandler { private readonly ILogger _logger; diff --git a/src/IdentityServer4/src/Endpoints/UserInfoEndpoint.cs b/src/IdentityServer4/src/Endpoints/UserInfoEndpoint.cs index 6f22aa590..f594966b3 100644 --- a/src/IdentityServer4/src/Endpoints/UserInfoEndpoint.cs +++ b/src/IdentityServer4/src/Endpoints/UserInfoEndpoint.cs @@ -3,21 +3,21 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Validation; +using ForgePoint.Identity.ResponseHandling; using Microsoft.Extensions.Logging; -using IdentityServer4.Hosting; -using IdentityServer4.Endpoints.Results; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Endpoints.Results; using IdentityModel; using Microsoft.AspNetCore.Http; using System.Net; -namespace IdentityServer4.Endpoints +namespace ForgePoint.Identity.Endpoints { /// /// The userinfo endpoint /// - /// + /// internal class UserInfoEndpoint : IEndpointHandler { private readonly BearerTokenUsageValidator _tokenUsageValidator; diff --git a/src/IdentityServer4/src/Events/ApiAuthenticationFailureEvent.cs b/src/IdentityServer4/src/Events/ApiAuthenticationFailureEvent.cs index bc19f280a..4701a52b7 100644 --- a/src/IdentityServer4/src/Events/ApiAuthenticationFailureEvent.cs +++ b/src/IdentityServer4/src/Events/ApiAuthenticationFailureEvent.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for failed API authentication /// - /// + /// public class ApiAuthenticationFailureEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/ApiAuthenticationSuccessEvent.cs b/src/IdentityServer4/src/Events/ApiAuthenticationSuccessEvent.cs index 7add829a8..b8ad91329 100644 --- a/src/IdentityServer4/src/Events/ApiAuthenticationSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/ApiAuthenticationSuccessEvent.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful API authentication /// - /// + /// public class ApiAuthenticationSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/ClientAuthenticationFailureEvent.cs b/src/IdentityServer4/src/Events/ClientAuthenticationFailureEvent.cs index 2ad4a7f02..807712fd4 100644 --- a/src/IdentityServer4/src/Events/ClientAuthenticationFailureEvent.cs +++ b/src/IdentityServer4/src/Events/ClientAuthenticationFailureEvent.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for failed client authentication /// - /// + /// public class ClientAuthenticationFailureEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/ClientAuthenticationSuccessEvent.cs b/src/IdentityServer4/src/Events/ClientAuthenticationSuccessEvent.cs index dee9627d7..0c9ed3127 100644 --- a/src/IdentityServer4/src/Events/ClientAuthenticationSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/ClientAuthenticationSuccessEvent.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful client authentication /// - /// + /// public class ClientAuthenticationSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/ConsentDeniedEvent.cs b/src/IdentityServer4/src/Events/ConsentDeniedEvent.cs index 67132a152..770dfe8ff 100644 --- a/src/IdentityServer4/src/Events/ConsentDeniedEvent.cs +++ b/src/IdentityServer4/src/Events/ConsentDeniedEvent.cs @@ -4,12 +4,12 @@ using System.Collections.Generic; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for denied consent. /// - /// + /// public class ConsentDeniedEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/ConsentGrantedEvent.cs b/src/IdentityServer4/src/Events/ConsentGrantedEvent.cs index 64dcd6b34..665deede1 100644 --- a/src/IdentityServer4/src/Events/ConsentGrantedEvent.cs +++ b/src/IdentityServer4/src/Events/ConsentGrantedEvent.cs @@ -4,12 +4,12 @@ using System.Collections.Generic; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for granted consent. /// - /// + /// public class ConsentGrantedEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/DeviceAuthorizationFailureEvent.cs b/src/IdentityServer4/src/Events/DeviceAuthorizationFailureEvent.cs index 0558d63e7..26b64fe9c 100644 --- a/src/IdentityServer4/src/Events/DeviceAuthorizationFailureEvent.cs +++ b/src/IdentityServer4/src/Events/DeviceAuthorizationFailureEvent.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for device authorization failure /// - /// + /// public class DeviceAuthorizationFailureEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/DeviceAuthorizationSuccessEvent.cs b/src/IdentityServer4/src/Events/DeviceAuthorizationSuccessEvent.cs index f39e102a2..184b0a4a8 100644 --- a/src/IdentityServer4/src/Events/DeviceAuthorizationSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/DeviceAuthorizationSuccessEvent.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for device authorization failure /// - /// + /// public class DeviceAuthorizationSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/GrantsRevokedEvent.cs b/src/IdentityServer4/src/Events/GrantsRevokedEvent.cs index 183bfe2e8..1e9d5fb66 100644 --- a/src/IdentityServer4/src/Events/GrantsRevokedEvent.cs +++ b/src/IdentityServer4/src/Events/GrantsRevokedEvent.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for revoked grants. /// - /// + /// public class GrantsRevokedEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/Infrastructure/Event.cs b/src/IdentityServer4/src/Events/Infrastructure/Event.cs index 64ab809fd..5cfce7bed 100644 --- a/src/IdentityServer4/src/Events/Infrastructure/Event.cs +++ b/src/IdentityServer4/src/Events/Infrastructure/Event.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Logging; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Models base class for events raised from IdentityServer. diff --git a/src/IdentityServer4/src/Events/Infrastructure/EventCategories.cs b/src/IdentityServer4/src/Events/Infrastructure/EventCategories.cs index e95d0ce9f..762baf784 100644 --- a/src/IdentityServer4/src/Events/Infrastructure/EventCategories.cs +++ b/src/IdentityServer4/src/Events/Infrastructure/EventCategories.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Categories for events diff --git a/src/IdentityServer4/src/Events/Infrastructure/EventIds.cs b/src/IdentityServer4/src/Events/Infrastructure/EventIds.cs index bcbaae25c..3ba6f4afd 100644 --- a/src/IdentityServer4/src/Events/Infrastructure/EventIds.cs +++ b/src/IdentityServer4/src/Events/Infrastructure/EventIds.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { public static class EventIds { diff --git a/src/IdentityServer4/src/Events/Infrastructure/EventType.cs b/src/IdentityServer4/src/Events/Infrastructure/EventType.cs index 6e0428024..0666027eb 100644 --- a/src/IdentityServer4/src/Events/Infrastructure/EventType.cs +++ b/src/IdentityServer4/src/Events/Infrastructure/EventType.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Indicates if the event is a success or fail event. diff --git a/src/IdentityServer4/src/Events/InvalidClientConfiguration.cs b/src/IdentityServer4/src/Events/InvalidClientConfiguration.cs index 035fce664..df27a5f0f 100644 --- a/src/IdentityServer4/src/Events/InvalidClientConfiguration.cs +++ b/src/IdentityServer4/src/Events/InvalidClientConfiguration.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for unhandled exceptions /// - /// + /// public class InvalidClientConfigurationEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/TokenIntrospectionFailureEvent.cs b/src/IdentityServer4/src/Events/TokenIntrospectionFailureEvent.cs index 47711fdf4..443ef9140 100644 --- a/src/IdentityServer4/src/Events/TokenIntrospectionFailureEvent.cs +++ b/src/IdentityServer4/src/Events/TokenIntrospectionFailureEvent.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System.Collections.Generic; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for failed token introspection /// - /// + /// public class TokenIntrospectionFailureEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/TokenIntrospectionSuccessEvent.cs b/src/IdentityServer4/src/Events/TokenIntrospectionSuccessEvent.cs index b689f8481..65e555df5 100644 --- a/src/IdentityServer4/src/Events/TokenIntrospectionSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/TokenIntrospectionSuccessEvent.cs @@ -2,17 +2,17 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful token introspection /// - /// + /// public class TokenIntrospectionSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/TokenIssuedFailureEvent.cs b/src/IdentityServer4/src/Events/TokenIssuedFailureEvent.cs index c4709d8c1..777a3fd7a 100644 --- a/src/IdentityServer4/src/Events/TokenIssuedFailureEvent.cs +++ b/src/IdentityServer4/src/Events/TokenIssuedFailureEvent.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Validation; -using static IdentityServer4.Constants; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; +using static ForgePoint.Identity.Constants; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for failed token issuance /// - /// + /// public class TokenIssuedFailureEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/TokenIssuedSuccessEvent.cs b/src/IdentityServer4/src/Events/TokenIssuedSuccessEvent.cs index 82fbcc41b..503d2b715 100644 --- a/src/IdentityServer4/src/Events/TokenIssuedSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/TokenIssuedSuccessEvent.cs @@ -3,18 +3,18 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Validation; using System.Collections.Generic; -using static IdentityServer4.Constants; +using static ForgePoint.Identity.Constants; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful token issuance /// - /// + /// public class TokenIssuedSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/TokenRevokedSuccessEvent.cs b/src/IdentityServer4/src/Events/TokenRevokedSuccessEvent.cs index 9c7aaf71b..37c24bbab 100644 --- a/src/IdentityServer4/src/Events/TokenRevokedSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/TokenRevokedSuccessEvent.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful token revocation /// - /// + /// public class TokenRevokedSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/UnhandledExceptionEvent.cs b/src/IdentityServer4/src/Events/UnhandledExceptionEvent.cs index 5e12b79a0..d919d4d3d 100644 --- a/src/IdentityServer4/src/Events/UnhandledExceptionEvent.cs +++ b/src/IdentityServer4/src/Events/UnhandledExceptionEvent.cs @@ -4,12 +4,12 @@ using System; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for unhandled exceptions /// - /// + /// public class UnhandledExceptionEvent : Event { /// diff --git a/src/IdentityServer4/src/Events/UserLoginFailureEvent.cs b/src/IdentityServer4/src/Events/UserLoginFailureEvent.cs index 8c00b4730..9b59bf064 100644 --- a/src/IdentityServer4/src/Events/UserLoginFailureEvent.cs +++ b/src/IdentityServer4/src/Events/UserLoginFailureEvent.cs @@ -2,18 +2,18 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using static IdentityServer4.Constants; +using static ForgePoint.Identity.Constants; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for failed user authentication /// - /// + /// public class UserLoginFailureEvent : Event { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The username. /// The error. diff --git a/src/IdentityServer4/src/Events/UserLoginSuccessEvent.cs b/src/IdentityServer4/src/Events/UserLoginSuccessEvent.cs index f78336c8d..c5173751a 100644 --- a/src/IdentityServer4/src/Events/UserLoginSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/UserLoginSuccessEvent.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using static IdentityServer4.Constants; +using static ForgePoint.Identity.Constants; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful user authentication /// - /// + /// public class UserLoginSuccessEvent : Event { // todo: consolidate ctors in 3.0 diff --git a/src/IdentityServer4/src/Events/UserLogoutSuccessEvent.cs b/src/IdentityServer4/src/Events/UserLogoutSuccessEvent.cs index 8ab7940cd..4f32438f5 100644 --- a/src/IdentityServer4/src/Events/UserLogoutSuccessEvent.cs +++ b/src/IdentityServer4/src/Events/UserLogoutSuccessEvent.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// Event for successful user logout /// - /// + /// public class UserLogoutSuccessEvent : Event { /// diff --git a/src/IdentityServer4/src/Extensions/AuthenticationPropertiesExtensions.cs b/src/IdentityServer4/src/Extensions/AuthenticationPropertiesExtensions.cs index 1c67fc5f2..8af91b024 100644 --- a/src/IdentityServer4/src/Extensions/AuthenticationPropertiesExtensions.cs +++ b/src/IdentityServer4/src/Extensions/AuthenticationPropertiesExtensions.cs @@ -9,7 +9,7 @@ using System.Linq; using System.Text; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { /// /// Extensions for AuthenticationProperties diff --git a/src/IdentityServer4/src/Extensions/AuthorizeResponseExtensions.cs b/src/IdentityServer4/src/Extensions/AuthorizeResponseExtensions.cs index fbfe01762..a2670c250 100644 --- a/src/IdentityServer4/src/Extensions/AuthorizeResponseExtensions.cs +++ b/src/IdentityServer4/src/Extensions/AuthorizeResponseExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.ResponseHandling; using System.Collections.Specialized; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { internal static class AuthorizeResponseExtensions { diff --git a/src/IdentityServer4/src/Extensions/ClaimsExtensions.cs b/src/IdentityServer4/src/Extensions/ClaimsExtensions.cs index 15eb034a0..97d0a8c8a 100644 --- a/src/IdentityServer4/src/Extensions/ClaimsExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ClaimsExtensions.cs @@ -9,7 +9,7 @@ using System.Security.Claims; using System.Text.Json; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { internal static class ClaimsExtensions { diff --git a/src/IdentityServer4/src/Extensions/ClientExtensions.cs b/src/IdentityServer4/src/Extensions/ClientExtensions.cs index 4aa3d33d3..6655566e3 100644 --- a/src/IdentityServer4/src/Extensions/ClientExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ClientExtensions.cs @@ -3,13 +3,14 @@ using Microsoft.IdentityModel.Tokens; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Extension methods for client. @@ -42,22 +43,60 @@ public static Task> GetKeysAsync(this IEnumerable secr .ToList(); keys.AddRange(certificates); - var jwks = secretList - .Where(s => s.Type == IdentityServerConstants.SecretTypes.JsonWebKey) - .Select(s => new Microsoft.IdentityModel.Tokens.JsonWebKey(s.Value)) - .ToList(); - keys.AddRange(jwks); + foreach (var secret in secretList.Where(s => s.Type == IdentityServerConstants.SecretTypes.JsonWebKey)) + { + try + { + keys.Add(ParseJsonWebKey(secret.Value)); + } + catch + { + // Skip malformed JWKs so one invalid secret does not disable the others. + } + } return Task.FromResult(keys); } + /// + /// IdentityModel 8 parses JWKs with System.Text.Json, which rejects tabs, trailing commas, + /// and Newtonsoft PascalCase property names. Fall back to Newtonsoft so existing stored secrets still load. + /// + private static Microsoft.IdentityModel.Tokens.JsonWebKey ParseJsonWebKey(string json) + { + try + { + return new Microsoft.IdentityModel.Tokens.JsonWebKey(json); + } + catch + { + var key = JsonConvert.DeserializeObject(json); + if (key == null || string.IsNullOrEmpty(key.Kty)) + { + throw; + } + + return key; + } + } + private static List GetCertificates(IEnumerable secrets) { return secrets .Where(s => s.Type == IdentityServerConstants.SecretTypes.X509CertificateBase64) - .Select(s => new X509Certificate2(Convert.FromBase64String(s.Value))) + .Select(LoadCertificate) .Where(c => c != null) .ToList(); } + + private static X509Certificate2 LoadCertificate(Secret secret) + { + var raw = Convert.FromBase64String(secret.Value); +#if NET9_0_OR_GREATER + return X509CertificateLoader.LoadCertificate(raw); +#else + return new X509Certificate2(raw); +#endif + } } } \ No newline at end of file diff --git a/src/IdentityServer4/src/Extensions/DateTimeExtensions.cs b/src/IdentityServer4/src/Extensions/DateTimeExtensions.cs index ea288c0b4..63056add6 100644 --- a/src/IdentityServer4/src/Extensions/DateTimeExtensions.cs +++ b/src/IdentityServer4/src/Extensions/DateTimeExtensions.cs @@ -5,7 +5,7 @@ using System; using System.Diagnostics; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { internal static class DateTimeExtensions { diff --git a/src/IdentityServer4/src/Extensions/EndpointOptionsExtensions.cs b/src/IdentityServer4/src/Extensions/EndpointOptionsExtensions.cs index f176e09a7..5d74fd445 100644 --- a/src/IdentityServer4/src/Extensions/EndpointOptionsExtensions.cs +++ b/src/IdentityServer4/src/Extensions/EndpointOptionsExtensions.cs @@ -1,30 +1,31 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using IdentityServer4.Configuration; -using IdentityServer4.Hosting; -using static IdentityServer4.Constants; - -namespace IdentityServer4.Extensions -{ - internal static class EndpointOptionsExtensions - { - public static bool IsEndpointEnabled(this EndpointsOptions options, Endpoint endpoint) - { - return endpoint?.Name switch - { - EndpointNames.Authorize => options.EnableAuthorizeEndpoint, - EndpointNames.CheckSession => options.EnableCheckSessionEndpoint, - EndpointNames.DeviceAuthorization => options.EnableDeviceAuthorizationEndpoint, - EndpointNames.Discovery => options.EnableDiscoveryEndpoint, - EndpointNames.EndSession => options.EnableEndSessionEndpoint, - EndpointNames.Introspection => options.EnableIntrospectionEndpoint, - EndpointNames.Revocation => options.EnableTokenRevocationEndpoint, - EndpointNames.Token => options.EnableTokenEndpoint, - EndpointNames.UserInfo => options.EnableUserInfoEndpoint, - _ => true - }; - } - } +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Hosting; +using static ForgePoint.Identity.Constants; + +namespace ForgePoint.Identity.Extensions +{ + internal static class EndpointOptionsExtensions + { + public static bool IsEndpointEnabled(this EndpointsOptions options, Endpoint endpoint) + { + return endpoint?.Name switch + { + EndpointNames.Authorize => options.EnableAuthorizeEndpoint, + EndpointNames.CheckSession => options.EnableCheckSessionEndpoint, + EndpointNames.DeviceAuthorization => options.EnableDeviceAuthorizationEndpoint, + EndpointNames.Discovery => options.EnableDiscoveryEndpoint, + EndpointNames.EndSession => options.EnableEndSessionEndpoint, + EndpointNames.Introspection => options.EnableIntrospectionEndpoint, + EndpointNames.Revocation => options.EnableTokenRevocationEndpoint, + EndpointNames.Token => options.EnableTokenEndpoint, + EndpointNames.UserInfo => options.EnableUserInfoEndpoint, + EndpointNames.PushedAuthorization => options.EnablePushedAuthorizationEndpoint, + _ => true + }; + } + } } \ No newline at end of file diff --git a/src/IdentityServer4/src/Extensions/HashExtensions.cs b/src/IdentityServer4/src/Extensions/HashExtensions.cs index aedbdeb5d..c0a7a9e90 100644 --- a/src/IdentityServer4/src/Extensions/HashExtensions.cs +++ b/src/IdentityServer4/src/Extensions/HashExtensions.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Security.Cryptography; using System.Text; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Extension methods for hashing strings diff --git a/src/IdentityServer4/src/Extensions/HttpContextAuthenticationExtensions.cs b/src/IdentityServer4/src/Extensions/HttpContextAuthenticationExtensions.cs index 6b8329d0e..911c6c5a1 100644 --- a/src/IdentityServer4/src/Extensions/HttpContextAuthenticationExtensions.cs +++ b/src/IdentityServer4/src/Extensions/HttpContextAuthenticationExtensions.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Configuration; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.DependencyInjection; using System; @@ -39,9 +39,9 @@ public static async Task SignInAsync(this HttpContext context, IdentityServerUse await context.SignInAsync(await context.GetCookieAuthenticationSchemeAsync(), user.CreatePrincipal(), properties); } - internal static ISystemClock GetClock(this HttpContext context) + internal static IClock GetClock(this HttpContext context) { - return context.RequestServices.GetRequiredService(); + return context.RequestServices.GetRequiredService(); } internal static async Task GetCookieAuthenticationSchemeAsync(this HttpContext context) diff --git a/src/IdentityServer4/src/Extensions/HttpContextExtensions.cs b/src/IdentityServer4/src/Extensions/HttpContextExtensions.cs index 97f13959c..b6646984c 100644 --- a/src/IdentityServer4/src/Extensions/HttpContextExtensions.cs +++ b/src/IdentityServer4/src/Extensions/HttpContextExtensions.cs @@ -2,20 +2,21 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Services; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using System; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using System.Linq; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; #pragma warning disable 1591 -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { public static class HttpContextExtensions { @@ -197,7 +198,7 @@ internal static async Task GetIdentityServerSignoutFrameCallbackUrlAsync if (endSessionMsg != null) { - var clock = context.RequestServices.GetRequiredService(); + var clock = context.RequestServices.GetRequiredService(); var msg = new Message(endSessionMsg, clock.UtcNow.UtcDateTime); var endSessionMessageStore = context.RequestServices.GetRequiredService>(); diff --git a/src/IdentityServer4/src/Extensions/HttpRequestExtensions.cs b/src/IdentityServer4/src/Extensions/HttpRequestExtensions.cs index 31d6e1c27..d23848be6 100644 --- a/src/IdentityServer4/src/Extensions/HttpRequestExtensions.cs +++ b/src/IdentityServer4/src/Extensions/HttpRequestExtensions.cs @@ -9,7 +9,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { public static class HttpRequestExtensions { diff --git a/src/IdentityServer4/src/Extensions/HttpResponseExtensions.cs b/src/IdentityServer4/src/Extensions/HttpResponseExtensions.cs index 4f5030661..457b75795 100644 --- a/src/IdentityServer4/src/Extensions/HttpResponseExtensions.cs +++ b/src/IdentityServer4/src/Extensions/HttpResponseExtensions.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using System.Linq; using System.Text; @@ -11,7 +11,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { public static class HttpResponseExtensions { diff --git a/src/IdentityServer4/src/Extensions/ICacheExtensions.cs b/src/IdentityServer4/src/Extensions/ICacheExtensions.cs index 531070507..470e41f3d 100644 --- a/src/IdentityServer4/src/Extensions/ICacheExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ICacheExtensions.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { /// /// Extensions for ICache diff --git a/src/IdentityServer4/src/Extensions/IClientStoreExtensions.cs b/src/IdentityServer4/src/Extensions/IClientStoreExtensions.cs index 321cd4ebf..46dceb368 100644 --- a/src/IdentityServer4/src/Extensions/IClientStoreExtensions.cs +++ b/src/IdentityServer4/src/Extensions/IClientStoreExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Extension for IClientStore diff --git a/src/IdentityServer4/src/Extensions/IEnumerableExtensions.cs b/src/IdentityServer4/src/Extensions/IEnumerableExtensions.cs index 6cbb25e6a..5b677b9f9 100644 --- a/src/IdentityServer4/src/Extensions/IEnumerableExtensions.cs +++ b/src/IdentityServer4/src/Extensions/IEnumerableExtensions.cs @@ -9,7 +9,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { public static class IEnumerableExtensions { diff --git a/src/IdentityServer4/src/Extensions/IReadableStringCollectionExtensions.cs b/src/IdentityServer4/src/Extensions/IReadableStringCollectionExtensions.cs index 3f0e17362..e2b620f5c 100644 --- a/src/IdentityServer4/src/Extensions/IReadableStringCollectionExtensions.cs +++ b/src/IdentityServer4/src/Extensions/IReadableStringCollectionExtensions.cs @@ -10,7 +10,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { public static class IReadableStringCollectionExtensions { diff --git a/src/IdentityServer4/src/Extensions/IResourceStoreExtensions.cs b/src/IdentityServer4/src/Extensions/IResourceStoreExtensions.cs index 09c1e2796..fb8ab21a1 100644 --- a/src/IdentityServer4/src/Extensions/IResourceStoreExtensions.cs +++ b/src/IdentityServer4/src/Extensions/IResourceStoreExtensions.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Extensions for IResourceStore diff --git a/src/IdentityServer4/src/Extensions/IUserSessionExtensions.cs b/src/IdentityServer4/src/Extensions/IUserSessionExtensions.cs index abc224a8c..6a574af44 100644 --- a/src/IdentityServer4/src/Extensions/IUserSessionExtensions.cs +++ b/src/IdentityServer4/src/Extensions/IUserSessionExtensions.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Extension for IUserSession. diff --git a/src/IdentityServer4/src/Extensions/IdentityServerToolsExtensions.cs b/src/IdentityServer4/src/Extensions/IdentityServerToolsExtensions.cs index 8fdab1a33..6750d9bed 100644 --- a/src/IdentityServer4/src/Extensions/IdentityServerToolsExtensions.cs +++ b/src/IdentityServer4/src/Extensions/IdentityServerToolsExtensions.cs @@ -6,11 +6,11 @@ using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; -namespace IdentityServer4 +namespace ForgePoint.Identity { /// /// Extensions for IdentityServerTools diff --git a/src/IdentityServer4/src/Extensions/NameValueCollectionExtensions.cs b/src/IdentityServer4/src/Extensions/NameValueCollectionExtensions.cs index 03cf689a9..09a5e6d5c 100644 --- a/src/IdentityServer4/src/Extensions/NameValueCollectionExtensions.cs +++ b/src/IdentityServer4/src/Extensions/NameValueCollectionExtensions.cs @@ -9,7 +9,7 @@ using System.Text; using System.Text.Encodings.Web; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { internal static class NameValueCollectionExtensions { diff --git a/src/IdentityServer4/src/Extensions/PrincipalExtensions.cs b/src/IdentityServer4/src/Extensions/PrincipalExtensions.cs index 8368af9a1..cfb16b13e 100644 --- a/src/IdentityServer4/src/Extensions/PrincipalExtensions.cs +++ b/src/IdentityServer4/src/Extensions/PrincipalExtensions.cs @@ -9,7 +9,7 @@ using System.Security.Claims; using System.Security.Principal; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { /// /// Extension methods for and . diff --git a/src/IdentityServer4/src/Extensions/ProfileDataRequestContextExtensions.cs b/src/IdentityServer4/src/Extensions/ProfileDataRequestContextExtensions.cs index f5617b89c..93a2d52c4 100644 --- a/src/IdentityServer4/src/Extensions/ProfileDataRequestContextExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ProfileDataRequestContextExtensions.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Extensions for ProfileDataRequestContext diff --git a/src/IdentityServer4/src/Extensions/ResourceExtensions.cs b/src/IdentityServer4/src/Extensions/ResourceExtensions.cs index 88c37ae4b..c9af9cf98 100644 --- a/src/IdentityServer4/src/Extensions/ResourceExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ResourceExtensions.cs @@ -5,10 +5,10 @@ using System; using System.Collections.Generic; using System.Linq; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Extensions for Resource diff --git a/src/IdentityServer4/src/Extensions/ScopeExtensions.cs b/src/IdentityServer4/src/Extensions/ScopeExtensions.cs index 483491970..2f341b12a 100644 --- a/src/IdentityServer4/src/Extensions/ScopeExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ScopeExtensions.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.Linq; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { internal static class ScopeExtensions { diff --git a/src/IdentityServer4/src/Extensions/StringsExtensions.cs b/src/IdentityServer4/src/Extensions/StringsExtensions.cs index 36c8ffee6..c17cc5c5a 100644 --- a/src/IdentityServer4/src/Extensions/StringsExtensions.cs +++ b/src/IdentityServer4/src/Extensions/StringsExtensions.cs @@ -11,7 +11,7 @@ using System.Text; using System.Text.Encodings.Web; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { internal static class StringExtensions { @@ -151,40 +151,51 @@ public static bool IsLocalUrl(this string url) return false; } - // Allows "/" or "/foo" but not "//" or "/\". + // Allows "/" or "/foo" but not "//" or "/\" and not URLs with control characters + // (CVE-2024-39694). Some browsers treat control chars as protocol-relative URLs. if (url[0] == '/') { - // url is exactly "/" if (url.Length == 1) { return true; } - // url doesn't start with "//" or "/\" - if (url[1] != '/' && url[1] != '\\') + if (url[1] == '/' || url[1] == '\\') { - return true; + return false; } - return false; + return !HasUnsafeLocalUrlCharacters(url.AsSpan(1)); } - // Allows "~/" or "~/foo" but not "~//" or "~/\". + // Allows "~/" or "~/foo" but not "~//" or "~/\" if (url[0] == '~' && url.Length > 1 && url[1] == '/') { - // url is exactly "~/" if (url.Length == 2) { return true; } - // url doesn't start with "~//" or "~/\" - if (url[2] != '/' && url[2] != '\\') + if (url[2] == '/' || url[2] == '\\') { - return true; + return false; } - return false; + return !HasUnsafeLocalUrlCharacters(url.AsSpan(2)); + } + + return false; + } + + private static bool HasUnsafeLocalUrlCharacters(ReadOnlySpan value) + { + for (var i = 0; i < value.Length; i++) + { + var ch = value[i]; + if (char.IsControl(ch) || ch == '\\') + { + return true; + } } return false; diff --git a/src/IdentityServer4/src/Extensions/TokenExtensions.cs b/src/IdentityServer4/src/Extensions/TokenExtensions.cs index 343ee5b2a..42e494e7d 100644 --- a/src/IdentityServer4/src/Extensions/TokenExtensions.cs +++ b/src/IdentityServer4/src/Extensions/TokenExtensions.cs @@ -3,18 +3,18 @@ using IdentityModel; -using IdentityServer4.Models; -using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Security.Claims; -using IdentityServer4.Configuration; +using System.Text.Json; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { /// /// Extensions for Token @@ -31,7 +31,7 @@ public static class TokenExtensions /// /// /// - public static JwtPayload CreateJwtPayload(this Token token, ISystemClock clock, IdentityServerOptions options, ILogger logger) + public static JwtPayload CreateJwtPayload(this Token token, IClock clock, IdentityServerOptions options, ILogger logger) { var payload = new JwtPayload( token.Issuer, @@ -89,9 +89,13 @@ public static JwtPayload CreateJwtPayload(this Token token, ISystemClock clock, // collection identity comparisons work for the anonymous type try { - var jsonTokens = jsonClaims.Select(x => new { x.Type, JsonValue = JRaw.Parse(x.Value) }).ToArray(); + var jsonTokens = jsonClaims.Select(x => + { + using var doc = JsonDocument.Parse(x.Value); + return new { x.Type, JsonValue = doc.RootElement.Clone() }; + }).ToArray(); - var jsonObjects = jsonTokens.Where(x => x.JsonValue.Type == JTokenType.Object).ToArray(); + var jsonObjects = jsonTokens.Where(x => x.JsonValue.ValueKind == JsonValueKind.Object).ToArray(); var jsonObjectGroups = jsonObjects.GroupBy(x => x.Type).ToArray(); foreach (var group in jsonObjectGroups) { @@ -103,7 +107,7 @@ public static JwtPayload CreateJwtPayload(this Token token, ISystemClock clock, if (group.Skip(1).Any()) { // add as array - payload.Add(group.Key, group.Select(x => x.JsonValue).ToArray()); + payload.Add(group.Key, group.Select(x => (object)x.JsonValue).ToArray()); } else { @@ -112,7 +116,7 @@ public static JwtPayload CreateJwtPayload(this Token token, ISystemClock clock, } } - var jsonArrays = jsonTokens.Where(x => x.JsonValue.Type == JTokenType.Array).ToArray(); + var jsonArrays = jsonTokens.Where(x => x.JsonValue.ValueKind == JsonValueKind.Array).ToArray(); var jsonArrayGroups = jsonArrays.GroupBy(x => x.Type).ToArray(); foreach (var group in jsonArrayGroups) { @@ -122,11 +126,13 @@ public static JwtPayload CreateJwtPayload(this Token token, ISystemClock clock, $"Can't add two claims where one is a JSON array and the other is not a JSON array ({group.Key})"); } - var newArr = new List(); + var newArr = new List(); foreach (var arrays in group) { - var arr = (JArray)arrays.JsonValue; - newArr.AddRange(arr); + foreach (var item in arrays.JsonValue.EnumerateArray()) + { + newArr.Add(item.Clone()); + } } // add just one array for the group/key/claim type diff --git a/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs b/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs index e352f4afd..fc0a19a1c 100644 --- a/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs @@ -3,7 +3,7 @@ using IdentityModel; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Linq; @@ -12,7 +12,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { public static class ValidatedAuthorizeRequestExtensions { diff --git a/src/IdentityServer4/src/Extensions/X509CertificateExtensions.cs b/src/IdentityServer4/src/Extensions/X509CertificateExtensions.cs index 6c4233070..d4a61c87f 100644 --- a/src/IdentityServer4/src/Extensions/X509CertificateExtensions.cs +++ b/src/IdentityServer4/src/Extensions/X509CertificateExtensions.cs @@ -4,7 +4,7 @@ using System.Text.Json; using IdentityModel; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { /// /// Extensions methods for X509Certificate2 diff --git a/src/IdentityServer4/src/Hosting/BaseUrlMiddleware.cs b/src/IdentityServer4/src/Hosting/BaseUrlMiddleware.cs index 19fcf721b..27c2aa365 100644 --- a/src/IdentityServer4/src/Hosting/BaseUrlMiddleware.cs +++ b/src/IdentityServer4/src/Hosting/BaseUrlMiddleware.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Http; using System.Threading.Tasks; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; #pragma warning disable 1591 -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { public class BaseUrlMiddleware { diff --git a/src/IdentityServer4/src/Hosting/CorsMiddleware.cs b/src/IdentityServer4/src/Hosting/CorsMiddleware.cs index e524b2d79..b02286416 100644 --- a/src/IdentityServer4/src/Hosting/CorsMiddleware.cs +++ b/src/IdentityServer4/src/Hosting/CorsMiddleware.cs @@ -2,13 +2,13 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; #pragma warning disable 1591 -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { public static class CorsMiddlewareExtensions { diff --git a/src/IdentityServer4/src/Hosting/CorsPolicyProvider.cs b/src/IdentityServer4/src/Hosting/CorsPolicyProvider.cs index e48c43137..8b6772e8f 100644 --- a/src/IdentityServer4/src/Hosting/CorsPolicyProvider.cs +++ b/src/IdentityServer4/src/Hosting/CorsPolicyProvider.cs @@ -7,13 +7,13 @@ using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Cors.Infrastructure; -using IdentityServer4.Configuration; -using IdentityServer4.Configuration.DependencyInjection; -using IdentityServer4.Services; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Configuration.DependencyInjection; +using ForgePoint.Identity.Services; using Microsoft.Extensions.DependencyInjection; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { internal class CorsPolicyProvider : ICorsPolicyProvider { diff --git a/src/IdentityServer4/src/Hosting/Endpoint.cs b/src/IdentityServer4/src/Hosting/Endpoint.cs index 5400c0367..6afd36da9 100644 --- a/src/IdentityServer4/src/Hosting/Endpoint.cs +++ b/src/IdentityServer4/src/Hosting/Endpoint.cs @@ -6,7 +6,7 @@ using System; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { public class Endpoint { diff --git a/src/IdentityServer4/src/Hosting/EndpointRouter.cs b/src/IdentityServer4/src/Hosting/EndpointRouter.cs index e136732b3..3252fc2a7 100644 --- a/src/IdentityServer4/src/Hosting/EndpointRouter.cs +++ b/src/IdentityServer4/src/Hosting/EndpointRouter.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { internal class EndpointRouter : IEndpointRouter { diff --git a/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestHandlerWrapper.cs b/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestHandlerWrapper.cs index 54b53c972..15e152853 100644 --- a/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestHandlerWrapper.cs +++ b/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestHandlerWrapper.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Hosting.FederatedSignOut +namespace ForgePoint.Identity.Hosting.FederatedSignOut { internal class AuthenticationRequestHandlerWrapper : IAuthenticationRequestHandler { diff --git a/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignInHandlerWrapper.cs b/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignInHandlerWrapper.cs index c32ed768f..c566f9f4b 100644 --- a/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignInHandlerWrapper.cs +++ b/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignInHandlerWrapper.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Hosting.FederatedSignOut +namespace ForgePoint.Identity.Hosting.FederatedSignOut { internal class AuthenticationRequestSignInHandlerWrapper : AuthenticationRequestSignOutHandlerWrapper, IAuthenticationSignInHandler { diff --git a/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignOutHandlerWrapper.cs b/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignOutHandlerWrapper.cs index 7f94520a1..2b1aee1ef 100644 --- a/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignOutHandlerWrapper.cs +++ b/src/IdentityServer4/src/Hosting/FederatedSignOut/AuthenticationRequestSignOutHandlerWrapper.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Hosting.FederatedSignOut +namespace ForgePoint.Identity.Hosting.FederatedSignOut { internal class AuthenticationRequestSignOutHandlerWrapper : AuthenticationRequestHandlerWrapper, IAuthenticationSignOutHandler { diff --git a/src/IdentityServer4/src/Hosting/FederatedSignOut/FederatedSignoutAuthenticationHandlerProvider.cs b/src/IdentityServer4/src/Hosting/FederatedSignOut/FederatedSignoutAuthenticationHandlerProvider.cs index a3f462f93..84e1b821a 100644 --- a/src/IdentityServer4/src/Hosting/FederatedSignOut/FederatedSignoutAuthenticationHandlerProvider.cs +++ b/src/IdentityServer4/src/Hosting/FederatedSignOut/FederatedSignoutAuthenticationHandlerProvider.cs @@ -3,11 +3,11 @@ using System.Threading.Tasks; -using IdentityServer4.Configuration.DependencyInjection; +using ForgePoint.Identity.Configuration.DependencyInjection; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Hosting.FederatedSignOut +namespace ForgePoint.Identity.Hosting.FederatedSignOut { // this intercepts IAuthenticationRequestHandler authentication handlers // to detect when they are handling federated signout. when they are invoked, diff --git a/src/IdentityServer4/src/Hosting/IEndpointHandler.cs b/src/IdentityServer4/src/Hosting/IEndpointHandler.cs index f116ce669..41041f532 100644 --- a/src/IdentityServer4/src/Hosting/IEndpointHandler.cs +++ b/src/IdentityServer4/src/Hosting/IEndpointHandler.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Http; using System.Threading.Tasks; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { /// /// Endpoint handler diff --git a/src/IdentityServer4/src/Hosting/IEndpointResult.cs b/src/IdentityServer4/src/Hosting/IEndpointResult.cs index 9063ca51c..fc35bce2d 100644 --- a/src/IdentityServer4/src/Hosting/IEndpointResult.cs +++ b/src/IdentityServer4/src/Hosting/IEndpointResult.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Http; using System.Threading.Tasks; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { /// /// Endpoint result diff --git a/src/IdentityServer4/src/Hosting/IEndpointRouter.cs b/src/IdentityServer4/src/Hosting/IEndpointRouter.cs index 88291b2e2..5aed28393 100644 --- a/src/IdentityServer4/src/Hosting/IEndpointRouter.cs +++ b/src/IdentityServer4/src/Hosting/IEndpointRouter.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { /// /// The endpoint router diff --git a/src/IdentityServer4/src/Hosting/IdentityServerAuthenticationService.cs b/src/IdentityServer4/src/Hosting/IdentityServerAuthenticationService.cs index 629b26983..759ed5cff 100644 --- a/src/IdentityServer4/src/Hosting/IdentityServerAuthenticationService.cs +++ b/src/IdentityServer4/src/Hosting/IdentityServerAuthenticationService.cs @@ -6,16 +6,17 @@ using Microsoft.AspNetCore.Http; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Logging; -using IdentityServer4.Configuration.DependencyInjection; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Configuration.DependencyInjection; +using ForgePoint.Identity.Extensions; using System; using IdentityModel; using System.Linq; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { // this decorates the real authentication service to detect when the // user is being signed in. this allows us to ensure the user has @@ -28,7 +29,7 @@ internal class IdentityServerAuthenticationService : IAuthenticationService { private readonly IAuthenticationService _inner; private readonly IAuthenticationSchemeProvider _schemes; - private readonly ISystemClock _clock; + private readonly IClock _clock; private readonly IUserSession _session; private readonly IBackChannelLogoutService _backChannelLogoutService; private readonly IdentityServerOptions _options; @@ -37,7 +38,7 @@ internal class IdentityServerAuthenticationService : IAuthenticationService public IdentityServerAuthenticationService( Decorator decorator, IAuthenticationSchemeProvider schemes, - ISystemClock clock, + IClock clock, IUserSession session, IBackChannelLogoutService backChannelLogoutService, IdentityServerOptions options, diff --git a/src/IdentityServer4/src/Hosting/IdentityServerHealthCheck.cs b/src/IdentityServer4/src/Hosting/IdentityServerHealthCheck.cs new file mode 100644 index 000000000..4b9eb2758 --- /dev/null +++ b/src/IdentityServer4/src/Hosting/IdentityServerHealthCheck.cs @@ -0,0 +1,39 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Threading; +using System.Threading.Tasks; +using ForgePoint.Identity.Services; +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace ForgePoint.Identity.Hosting +{ + /// + /// Health check that verifies IdentityServer has signing credentials configured. + /// + public class IdentityServerHealthCheck : IHealthCheck + { + private readonly IKeyMaterialService _keys; + + /// + /// Initializes a new instance of the class. + /// + public IdentityServerHealthCheck(IKeyMaterialService keys) + { + _keys = keys; + } + + /// + public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) + { + var credential = await _keys.GetSigningCredentialsAsync(); + if (credential == null) + { + return HealthCheckResult.Unhealthy("IdentityServer has no signing credentials configured."); + } + + return HealthCheckResult.Healthy("IdentityServer is ready."); + } + } +} diff --git a/src/IdentityServer4/src/Hosting/IdentityServerMiddleware.cs b/src/IdentityServer4/src/Hosting/IdentityServerMiddleware.cs index 2b6f7934f..e6ee6058c 100644 --- a/src/IdentityServer4/src/Hosting/IdentityServerMiddleware.cs +++ b/src/IdentityServer4/src/Hosting/IdentityServerMiddleware.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Services; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { /// /// IdentityServer middleware diff --git a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationEvents.cs b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationEvents.cs index e820b36ec..453c8a164 100644 --- a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationEvents.cs +++ b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationEvents.cs @@ -3,7 +3,7 @@ using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Hosting.LocalApiAuthentication +namespace ForgePoint.Identity.Hosting.LocalApiAuthentication { /// /// Events for local API authentication diff --git a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationExtensions.cs b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationExtensions.cs index 547e4bab5..e2a8fd364 100644 --- a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationExtensions.cs +++ b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationExtensions.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Hosting.LocalApiAuthentication; +using ForgePoint.Identity; +using ForgePoint.Identity.Hosting.LocalApiAuthentication; using Microsoft.AspNetCore.Authentication; using System; using System.Security.Claims; diff --git a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs index ee44ac2b8..e9447a19a 100644 --- a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs +++ b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationHandler.cs @@ -3,7 +3,7 @@ using IdentityModel; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -11,8 +11,9 @@ using System.Security.Claims; using System.Text.Encodings.Web; using System.Threading.Tasks; +using ForgePoint.Identity; -namespace IdentityServer4.Hosting.LocalApiAuthentication +namespace ForgePoint.Identity.Hosting.LocalApiAuthentication { /// /// Authentication handler for validating access token from the local IdentityServer @@ -23,8 +24,8 @@ public class LocalApiAuthenticationHandler : AuthenticationHandler - public LocalApiAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, ITokenValidator tokenValidator) - : base(options, logger, encoder, clock) + public LocalApiAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ITokenValidator tokenValidator) + : base(options, logger, encoder) { _tokenValidator = tokenValidator; _logger = logger.CreateLogger(); diff --git a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationOptions.cs b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationOptions.cs index 1389be0a0..cfe12152e 100644 --- a/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationOptions.cs +++ b/src/IdentityServer4/src/Hosting/LocalApiAuthentication/LocalApiAuthenticationOptions.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authentication; -namespace IdentityServer4.Hosting.LocalApiAuthentication +namespace ForgePoint.Identity.Hosting.LocalApiAuthentication { /// /// Options for local API authentication diff --git a/src/IdentityServer4/src/Hosting/MutualTlsEndpointMiddleware.cs b/src/IdentityServer4/src/Hosting/MutualTlsEndpointMiddleware.cs index 25c53d616..b9bc95533 100644 --- a/src/IdentityServer4/src/Hosting/MutualTlsEndpointMiddleware.cs +++ b/src/IdentityServer4/src/Hosting/MutualTlsEndpointMiddleware.cs @@ -1,12 +1,12 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Hosting +namespace ForgePoint.Identity.Hosting { /// /// Middleware for re-writing the MTLS enabled endpoints to the standard protocol endpoints diff --git a/src/IdentityServer4/src/IdentityServer4.csproj b/src/IdentityServer4/src/IdentityServer4.csproj index ffc8ce2dc..54b41e40c 100644 --- a/src/IdentityServer4/src/IdentityServer4.csproj +++ b/src/IdentityServer4/src/IdentityServer4.csproj @@ -1,16 +1,14 @@  - IdentityServer4 - netcoreapp3.1 - OpenID Connect and OAuth 2.0 Framework for ASP.NET Core - Brock Allen;Dominick Baier - IdentityServer4 - OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;IdentityServer + ForgePoint.Identity + net8.0;net10.0 + OpenID Connect and OAuth 2.0 framework for ASP.NET Core. Apache-2.0 continuation of IdentityServer4 by ForgePoint Labs. + ForgePoint.Identity + ForgePoint.Identity + OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;ForgePoint;IdentityServer4 icon.jpg - https://github.com/IdentityServer/IdentityServer4 Apache-2.0 - https://github.com/IdentityServer/IdentityServer4/releases true @@ -40,7 +38,7 @@ - + diff --git a/src/IdentityServer4/src/IdentityServerConstants.cs b/src/IdentityServer4/src/IdentityServerConstants.cs index 994be4be5..bcd3f4909 100644 --- a/src/IdentityServer4/src/IdentityServerConstants.cs +++ b/src/IdentityServer4/src/IdentityServerConstants.cs @@ -6,7 +6,7 @@ using Microsoft.IdentityModel.Tokens; using System.Collections.Generic; -namespace IdentityServer4 +namespace ForgePoint.Identity { public static class IdentityServerConstants { @@ -152,6 +152,7 @@ public static class PersistedGrantTypes public const string UserConsent = "user_consent"; public const string DeviceCode = "device_code"; public const string UserCode = "user_code"; + public const string PushedAuthorization = "par"; } public static class UserCodeTypes diff --git a/src/IdentityServer4/src/IdentityServerTools.cs b/src/IdentityServer4/src/IdentityServerTools.cs index 1e2ab2ae5..039de3e96 100644 --- a/src/IdentityServer4/src/IdentityServerTools.cs +++ b/src/IdentityServer4/src/IdentityServerTools.cs @@ -2,18 +2,19 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System.Security.Claims; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using IdentityModel; using System; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4 +namespace ForgePoint.Identity { /// /// Class for useful helpers for interacting with IdentityServer @@ -22,7 +23,7 @@ public class IdentityServerTools { internal readonly IHttpContextAccessor ContextAccessor; private readonly ITokenCreationService _tokenCreation; - private readonly ISystemClock _clock; + private readonly IClock _clock; /// /// Initializes a new instance of the class. @@ -30,7 +31,7 @@ public class IdentityServerTools /// The context accessor. /// The token creation service. /// The clock. - public IdentityServerTools(IHttpContextAccessor contextAccessor, ITokenCreationService tokenCreation, ISystemClock clock) + public IdentityServerTools(IHttpContextAccessor contextAccessor, ITokenCreationService tokenCreation, IClock clock) { ContextAccessor = contextAccessor; _tokenCreation = tokenCreation; diff --git a/src/IdentityServer4/src/IdentityServerUser.cs b/src/IdentityServer4/src/IdentityServerUser.cs index b61a140f2..f5e39a2e2 100644 --- a/src/IdentityServer4/src/IdentityServerUser.cs +++ b/src/IdentityServer4/src/IdentityServerUser.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; -namespace IdentityServer4 +namespace ForgePoint.Identity { /// /// Model properties of an IdentityServer user diff --git a/src/IdentityServer4/src/Infrastructure/DefaultClock.cs b/src/IdentityServer4/src/Infrastructure/DefaultClock.cs new file mode 100644 index 000000000..0f22479df --- /dev/null +++ b/src/IdentityServer4/src/Infrastructure/DefaultClock.cs @@ -0,0 +1,28 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System; + +namespace ForgePoint.Identity +{ + /// + /// Default implementation backed by . + /// + public class DefaultClock : IClock + { + private readonly TimeProvider _timeProvider; + + /// + /// Initializes a new instance of the class. + /// + /// The time provider. Defaults to . + public DefaultClock(TimeProvider timeProvider = null) + { + _timeProvider = timeProvider ?? TimeProvider.System; + } + + /// + public DateTimeOffset UtcNow => _timeProvider.GetUtcNow(); + } +} diff --git a/src/IdentityServer4/src/Infrastructure/DistributedCacheStateDataFormatter.cs b/src/IdentityServer4/src/Infrastructure/DistributedCacheStateDataFormatter.cs index 2b7bb3e93..5f3ff61be 100644 --- a/src/IdentityServer4/src/Infrastructure/DistributedCacheStateDataFormatter.cs +++ b/src/IdentityServer4/src/Infrastructure/DistributedCacheStateDataFormatter.cs @@ -10,7 +10,7 @@ using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.DependencyInjection; -namespace IdentityServer4.Infrastructure +namespace ForgePoint.Identity.Infrastructure { /// /// State formatter using IDistributedCache diff --git a/src/IdentityServer4/src/Infrastructure/IClock.cs b/src/IdentityServer4/src/Infrastructure/IClock.cs new file mode 100644 index 000000000..974928541 --- /dev/null +++ b/src/IdentityServer4/src/Infrastructure/IClock.cs @@ -0,0 +1,20 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System; + +namespace ForgePoint.Identity +{ + /// + /// Abstraction over the system clock so IdentityServer can be tested + /// and can use on modern .NET. + /// + public interface IClock + { + /// + /// The current UTC time. + /// + DateTimeOffset UtcNow { get; } + } +} diff --git a/src/IdentityServer4/src/Infrastructure/MessageCookie.cs b/src/IdentityServer4/src/Infrastructure/MessageCookie.cs index c341f4f43..dfd20d796 100644 --- a/src/IdentityServer4/src/Infrastructure/MessageCookie.cs +++ b/src/IdentityServer4/src/Infrastructure/MessageCookie.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; @@ -13,7 +13,7 @@ using System.Linq; using System.Security.Cryptography; -namespace IdentityServer4 +namespace ForgePoint.Identity { internal class MessageCookie { diff --git a/src/IdentityServer4/src/Infrastructure/ObjectSerializer.cs b/src/IdentityServer4/src/Infrastructure/ObjectSerializer.cs index f88480aae..e3bea5e84 100644 --- a/src/IdentityServer4/src/Infrastructure/ObjectSerializer.cs +++ b/src/IdentityServer4/src/Infrastructure/ObjectSerializer.cs @@ -3,14 +3,15 @@ using System.Text.Json; +using System.Text.Json.Serialization; -namespace IdentityServer4 +namespace ForgePoint.Identity { internal static class ObjectSerializer { private static readonly JsonSerializerOptions Options = new JsonSerializerOptions { - IgnoreNullValues = true + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; public static string ToString(object o) diff --git a/src/IdentityServer4/src/Logging/LogSerializer.cs b/src/IdentityServer4/src/Logging/LogSerializer.cs index 4a5873317..af8871354 100644 --- a/src/IdentityServer4/src/Logging/LogSerializer.cs +++ b/src/IdentityServer4/src/Logging/LogSerializer.cs @@ -5,7 +5,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace IdentityServer4.Logging +namespace ForgePoint.Identity.Logging { /// /// Helper to JSON serialize object data for logging. @@ -14,7 +14,7 @@ internal static class LogSerializer { static readonly JsonSerializerOptions Options = new JsonSerializerOptions { - IgnoreNullValues = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, WriteIndented = true }; diff --git a/src/IdentityServer4/src/Logging/Models/AuthorizeRequestValidationLog.cs b/src/IdentityServer4/src/Logging/Models/AuthorizeRequestValidationLog.cs index 9988762c7..283c3aa85 100644 --- a/src/IdentityServer4/src/Logging/Models/AuthorizeRequestValidationLog.cs +++ b/src/IdentityServer4/src/Logging/Models/AuthorizeRequestValidationLog.cs @@ -5,10 +5,10 @@ using System.Collections.Generic; using System.Linq; using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Logging.Models +namespace ForgePoint.Identity.Logging.Models { internal class AuthorizeRequestValidationLog { diff --git a/src/IdentityServer4/src/Logging/Models/AuthorizeResponseLog.cs b/src/IdentityServer4/src/Logging/Models/AuthorizeResponseLog.cs index c90fefcc5..0058dfa9f 100644 --- a/src/IdentityServer4/src/Logging/Models/AuthorizeResponseLog.cs +++ b/src/IdentityServer4/src/Logging/Models/AuthorizeResponseLog.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.ResponseHandling; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.ResponseHandling; -namespace IdentityServer4.Logging.Models +namespace ForgePoint.Identity.Logging.Models { internal class AuthorizeResponseLog { diff --git a/src/IdentityServer4/src/Logging/Models/DeviceAuthorizationRequestValidationLog.cs b/src/IdentityServer4/src/Logging/Models/DeviceAuthorizationRequestValidationLog.cs index 677a4e460..35eca6cab 100644 --- a/src/IdentityServer4/src/Logging/Models/DeviceAuthorizationRequestValidationLog.cs +++ b/src/IdentityServer4/src/Logging/Models/DeviceAuthorizationRequestValidationLog.cs @@ -4,10 +4,10 @@ using System.Collections.Generic; using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Logging +namespace ForgePoint.Identity.Logging { internal class DeviceAuthorizationRequestValidationLog { diff --git a/src/IdentityServer4/src/Logging/Models/EndSessionRequestValidationLog.cs b/src/IdentityServer4/src/Logging/Models/EndSessionRequestValidationLog.cs index fd9cbcbf2..38964852b 100644 --- a/src/IdentityServer4/src/Logging/Models/EndSessionRequestValidationLog.cs +++ b/src/IdentityServer4/src/Logging/Models/EndSessionRequestValidationLog.cs @@ -4,10 +4,10 @@ using System.Collections.Generic; using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Logging.Models +namespace ForgePoint.Identity.Logging.Models { internal class EndSessionRequestValidationLog { diff --git a/src/IdentityServer4/src/Logging/Models/TokenRequestValidationLog.cs b/src/IdentityServer4/src/Logging/Models/TokenRequestValidationLog.cs index 7e8431d39..8e001c4fc 100644 --- a/src/IdentityServer4/src/Logging/Models/TokenRequestValidationLog.cs +++ b/src/IdentityServer4/src/Logging/Models/TokenRequestValidationLog.cs @@ -5,10 +5,10 @@ using System.Collections.Generic; using System.Linq; using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Logging.Models +namespace ForgePoint.Identity.Logging.Models { internal class TokenRequestValidationLog { diff --git a/src/IdentityServer4/src/Logging/Models/TokenValidationLog.cs b/src/IdentityServer4/src/Logging/Models/TokenValidationLog.cs index a1a26e859..78da2402f 100644 --- a/src/IdentityServer4/src/Logging/Models/TokenValidationLog.cs +++ b/src/IdentityServer4/src/Logging/Models/TokenValidationLog.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Logging.Models +namespace ForgePoint.Identity.Logging.Models { internal class TokenValidationLog { diff --git a/src/IdentityServer4/src/Models/Contexts/IsActiveContext.cs b/src/IdentityServer4/src/Models/Contexts/IsActiveContext.cs index ba68fd036..1f52136d8 100644 --- a/src/IdentityServer4/src/Models/Contexts/IsActiveContext.cs +++ b/src/IdentityServer4/src/Models/Contexts/IsActiveContext.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Context describing the is-active check diff --git a/src/IdentityServer4/src/Models/Contexts/LogoutNotificationContext.cs b/src/IdentityServer4/src/Models/Contexts/LogoutNotificationContext.cs index c6ea75490..2b1987658 100644 --- a/src/IdentityServer4/src/Models/Contexts/LogoutNotificationContext.cs +++ b/src/IdentityServer4/src/Models/Contexts/LogoutNotificationContext.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Provides the context necessary to construct a logout notificaiton. diff --git a/src/IdentityServer4/src/Models/Contexts/ProfileDataRequestContext.cs b/src/IdentityServer4/src/Models/Contexts/ProfileDataRequestContext.cs index 254fb9db8..7a3474507 100644 --- a/src/IdentityServer4/src/Models/Contexts/ProfileDataRequestContext.cs +++ b/src/IdentityServer4/src/Models/Contexts/ProfileDataRequestContext.cs @@ -5,9 +5,9 @@ using System.Collections.Generic; using System.Security.Claims; using System; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Class describing the profile data request diff --git a/src/IdentityServer4/src/Models/DeviceFlowAuthorizationRequest.cs b/src/IdentityServer4/src/Models/DeviceFlowAuthorizationRequest.cs index 8b790ff99..aa0bfc64d 100644 --- a/src/IdentityServer4/src/Models/DeviceFlowAuthorizationRequest.cs +++ b/src/IdentityServer4/src/Models/DeviceFlowAuthorizationRequest.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Represents contextual information about a device flow authorization request. diff --git a/src/IdentityServer4/src/Models/DeviceFlowInteractionResult.cs b/src/IdentityServer4/src/Models/DeviceFlowInteractionResult.cs index ea70690a1..03da4da4d 100644 --- a/src/IdentityServer4/src/Models/DeviceFlowInteractionResult.cs +++ b/src/IdentityServer4/src/Models/DeviceFlowInteractionResult.cs @@ -1,7 +1,7 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Request object for device flow interaction diff --git a/src/IdentityServer4/src/Models/DiscoveryDocument.cs b/src/IdentityServer4/src/Models/DiscoveryDocument.cs index 41f70b6a5..2cc02302d 100644 --- a/src/IdentityServer4/src/Models/DiscoveryDocument.cs +++ b/src/IdentityServer4/src/Models/DiscoveryDocument.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { public class DiscoveryDocument { diff --git a/src/IdentityServer4/src/Models/Grant.cs b/src/IdentityServer4/src/Models/Grant.cs index d9457cbf5..e18e5b3b8 100644 --- a/src/IdentityServer4/src/Models/Grant.cs +++ b/src/IdentityServer4/src/Models/Grant.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a grant the user has given. diff --git a/src/IdentityServer4/src/Models/GrantTypes.cs b/src/IdentityServer4/src/Models/GrantTypes.cs index 7aa37632e..3a5b2ca62 100644 --- a/src/IdentityServer4/src/Models/GrantTypes.cs +++ b/src/IdentityServer4/src/Models/GrantTypes.cs @@ -6,7 +6,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { public class GrantTypes { diff --git a/src/IdentityServer4/src/Models/IdentityResources.cs b/src/IdentityServer4/src/Models/IdentityResources.cs index 997d1153c..ede6e3341 100644 --- a/src/IdentityServer4/src/Models/IdentityResources.cs +++ b/src/IdentityServer4/src/Models/IdentityResources.cs @@ -5,7 +5,7 @@ using IdentityModel; using System.Linq; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Convenience class that defines standard identity resources. @@ -15,7 +15,7 @@ public static class IdentityResources /// /// Models the standard openid scope /// - /// + /// public class OpenId : IdentityResource { /// @@ -33,7 +33,7 @@ public OpenId() /// /// Models the standard profile scope /// - /// + /// public class Profile : IdentityResource { /// @@ -52,7 +52,7 @@ public Profile() /// /// Models the standard email scope /// - /// + /// public class Email : IdentityResource { /// @@ -70,7 +70,7 @@ public Email() /// /// Models the standard phone scope /// - /// + /// public class Phone : IdentityResource { /// @@ -88,7 +88,7 @@ public Phone() /// /// Models the standard address scope /// - /// + /// public class Address : IdentityResource { /// diff --git a/src/IdentityServer4/src/Models/JsonWebKey.cs b/src/IdentityServer4/src/Models/JsonWebKey.cs index db227c354..f276d3984 100644 --- a/src/IdentityServer4/src/Models/JsonWebKey.cs +++ b/src/IdentityServer4/src/Models/JsonWebKey.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { public class JsonWebKey { diff --git a/src/IdentityServer4/src/Models/Messages/AuthorizationRequest.cs b/src/IdentityServer4/src/Models/Messages/AuthorizationRequest.cs index f7b656128..57f68f4a7 100644 --- a/src/IdentityServer4/src/Models/Messages/AuthorizationRequest.cs +++ b/src/IdentityServer4/src/Models/Messages/AuthorizationRequest.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Represents contextual information about a authorization request. diff --git a/src/IdentityServer4/src/Models/Messages/ConsentRequest.cs b/src/IdentityServer4/src/Models/Messages/ConsentRequest.cs index e4067b003..bc81879d0 100644 --- a/src/IdentityServer4/src/Models/Messages/ConsentRequest.cs +++ b/src/IdentityServer4/src/Models/Messages/ConsentRequest.cs @@ -3,14 +3,14 @@ using IdentityModel; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Security.Cryptography; using System.Text; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models the parameters to identify a request for consent. diff --git a/src/IdentityServer4/src/Models/Messages/ConsentResponse.cs b/src/IdentityServer4/src/Models/Messages/ConsentResponse.cs index b90e19a20..67c0f1b42 100644 --- a/src/IdentityServer4/src/Models/Messages/ConsentResponse.cs +++ b/src/IdentityServer4/src/Models/Messages/ConsentResponse.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models the user's response to the consent screen. diff --git a/src/IdentityServer4/src/Models/Messages/ErrorMessage.cs b/src/IdentityServer4/src/Models/Messages/ErrorMessage.cs index 282c55b13..5473f9fbe 100644 --- a/src/IdentityServer4/src/Models/Messages/ErrorMessage.cs +++ b/src/IdentityServer4/src/Models/Messages/ErrorMessage.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models the data for the error page. diff --git a/src/IdentityServer4/src/Models/Messages/LogoutRequest.cs b/src/IdentityServer4/src/Models/Messages/LogoutRequest.cs index 61a9db899..2126c1905 100644 --- a/src/IdentityServer4/src/Models/Messages/LogoutRequest.cs +++ b/src/IdentityServer4/src/Models/Messages/LogoutRequest.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models the validated singout context. diff --git a/src/IdentityServer4/src/Models/Messages/Message.cs b/src/IdentityServer4/src/Models/Messages/Message.cs index a3fda4713..ca739f1c3 100644 --- a/src/IdentityServer4/src/Models/Messages/Message.cs +++ b/src/IdentityServer4/src/Models/Messages/Message.cs @@ -5,7 +5,7 @@ using System; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Base class for data that needs to be written out as cookies. diff --git a/src/IdentityServer4/src/Models/ParsedSecret.cs b/src/IdentityServer4/src/Models/ParsedSecret.cs index 8770845b4..522aa3b43 100644 --- a/src/IdentityServer4/src/Models/ParsedSecret.cs +++ b/src/IdentityServer4/src/Models/ParsedSecret.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Represents a secret extracted from the HttpContext diff --git a/src/IdentityServer4/src/Models/PushedAuthorizationRequest.cs b/src/IdentityServer4/src/Models/PushedAuthorizationRequest.cs new file mode 100644 index 000000000..d73f0bad5 --- /dev/null +++ b/src/IdentityServer4/src/Models/PushedAuthorizationRequest.cs @@ -0,0 +1,24 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Collections.Generic; + +namespace ForgePoint.Identity.Models +{ + /// + /// A stored OAuth 2.0 Pushed Authorization Request (RFC 9126). + /// + public class PushedAuthorizationRequest + { + /// + /// The client that created the request. + /// + public string ClientId { get; set; } + + /// + /// Authorization parameters captured at the PAR endpoint. + /// + public Dictionary Parameters { get; set; } = new Dictionary(); + } +} diff --git a/src/IdentityServer4/src/Models/SecurityKeyInfo.cs b/src/IdentityServer4/src/Models/SecurityKeyInfo.cs index 5fb3a6699..6059b2b4e 100644 --- a/src/IdentityServer4/src/Models/SecurityKeyInfo.cs +++ b/src/IdentityServer4/src/Models/SecurityKeyInfo.cs @@ -4,7 +4,7 @@ using Microsoft.IdentityModel.Tokens; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Information about a security key diff --git a/src/IdentityServer4/src/Models/TokenCreationRequest.cs b/src/IdentityServer4/src/Models/TokenCreationRequest.cs index fc1637d10..07eb4e6fd 100644 --- a/src/IdentityServer4/src/Models/TokenCreationRequest.cs +++ b/src/IdentityServer4/src/Models/TokenCreationRequest.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models the data to create a token from a validated request. diff --git a/src/IdentityServer4/src/Models/TokenRequestErrors.cs b/src/IdentityServer4/src/Models/TokenRequestErrors.cs index cc101168e..ab400a829 100644 --- a/src/IdentityServer4/src/Models/TokenRequestErrors.cs +++ b/src/IdentityServer4/src/Models/TokenRequestErrors.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Token request errors diff --git a/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeInteractionResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeInteractionResponseGenerator.cs index 1952a7805..66387ba6a 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeInteractionResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeInteractionResponseGenerator.cs @@ -3,22 +3,23 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Default logic for determining if user must login or consent when making requests to the authorization endpoint. /// - /// + /// public class AuthorizeInteractionResponseGenerator : IAuthorizeInteractionResponseGenerator { /// @@ -39,7 +40,7 @@ public class AuthorizeInteractionResponseGenerator : IAuthorizeInteractionRespon /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// Initializes a new instance of the class. @@ -49,7 +50,7 @@ public class AuthorizeInteractionResponseGenerator : IAuthorizeInteractionRespon /// The consent. /// The profile. public AuthorizeInteractionResponseGenerator( - ISystemClock clock, + IClock clock, ILogger logger, IConsentService consent, IProfileService profile) diff --git a/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeResponseGenerator.cs index 8a9f470f0..b4f53a983 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/AuthorizeResponseGenerator.cs @@ -3,24 +3,25 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// The authorize response generator /// - /// + /// public class AuthorizeResponseGenerator : IAuthorizeResponseGenerator { /// @@ -46,7 +47,7 @@ public class AuthorizeResponseGenerator : IAuthorizeResponseGenerator /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// The key material service @@ -63,7 +64,7 @@ public class AuthorizeResponseGenerator : IAuthorizeResponseGenerator /// The authorization code store. /// The events. public AuthorizeResponseGenerator( - ISystemClock clock, + IClock clock, ITokenService tokenService, IKeyMaterialService keyMaterialService, IAuthorizationCodeStore authorizationCodeStore, diff --git a/src/IdentityServer4/src/ResponseHandling/Default/DeviceAuthorizationResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/DeviceAuthorizationResponseGenerator.cs index f48f15065..2f1521a0e 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/DeviceAuthorizationResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/DeviceAuthorizationResponseGenerator.cs @@ -4,20 +4,21 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; +using ForgePoint.Identity; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// The device authorizaiton response generator /// - /// + /// public class DeviceAuthorizationResponseGenerator : IDeviceAuthorizationResponseGenerator { /// @@ -38,7 +39,7 @@ public class DeviceAuthorizationResponseGenerator : IDeviceAuthorizationResponse /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// The logger @@ -53,7 +54,7 @@ public class DeviceAuthorizationResponseGenerator : IDeviceAuthorizationResponse /// The device flow code service. /// The clock. /// The logger. - public DeviceAuthorizationResponseGenerator(IdentityServerOptions options, IUserCodeService userCodeService, IDeviceFlowCodeService deviceFlowCodeService, ISystemClock clock, ILogger logger) + public DeviceAuthorizationResponseGenerator(IdentityServerOptions options, IUserCodeService userCodeService, IDeviceFlowCodeService deviceFlowCodeService, IClock clock, ILogger logger) { Options = options; UserCodeService = userCodeService; diff --git a/src/IdentityServer4/src/ResponseHandling/Default/DiscoveryResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/DiscoveryResponseGenerator.cs index 48755d073..2a2ddd1fd 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/DiscoveryResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/DiscoveryResponseGenerator.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Tokens; using System; @@ -16,12 +16,12 @@ using System.Security.Cryptography; using System.Threading.Tasks; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Default implementation of the discovery endpoint response generator /// - /// + /// public class DiscoveryResponseGenerator : IDiscoveryResponseGenerator { /// @@ -151,6 +151,15 @@ public virtual async Task> CreateDiscoveryDocumentAsy entries.Add(OidcConstants.Discovery.DeviceAuthorizationEndpoint, baseUrl + Constants.ProtocolRoutePaths.DeviceAuthorization); } + if (Options.Endpoints.EnablePushedAuthorizationEndpoint) + { + entries.Add("pushed_authorization_request_endpoint", baseUrl + Constants.ProtocolRoutePaths.PushedAuthorization); + if (Options.PushedAuthorization.Required) + { + entries.Add("require_pushed_authorization_requests", true); + } + } + if (Options.MutualTls.Enabled) { var mtlsEndpoints = new Dictionary(); diff --git a/src/IdentityServer4/src/ResponseHandling/Default/IntrospectionResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/IntrospectionResponseGenerator.cs index 77bb97d57..dec46d0ff 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/IntrospectionResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/IntrospectionResponseGenerator.cs @@ -3,21 +3,21 @@ using IdentityModel; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// The introspection response generator /// - /// + /// public class IntrospectionResponseGenerator : IIntrospectionResponseGenerator { /// diff --git a/src/IdentityServer4/src/ResponseHandling/Default/TokenResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/TokenResponseGenerator.cs index 12f4863b9..2aa01cd53 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/TokenResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/TokenResponseGenerator.cs @@ -3,23 +3,24 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// The default token response generator /// - /// + /// public class TokenResponseGenerator : ITokenResponseGenerator { /// @@ -55,7 +56,7 @@ public class TokenResponseGenerator : ITokenResponseGenerator /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// Initializes a new instance of the class. @@ -67,7 +68,7 @@ public class TokenResponseGenerator : ITokenResponseGenerator /// The resources. /// The clients. /// The logger. - public TokenResponseGenerator(ISystemClock clock, ITokenService tokenService, IRefreshTokenService refreshTokenService, IScopeParser scopeParser, IResourceStore resources, IClientStore clients, ILogger logger) + public TokenResponseGenerator(IClock clock, ITokenService tokenService, IRefreshTokenService refreshTokenService, IScopeParser scopeParser, IResourceStore resources, IClientStore clients, ILogger logger) { Clock = clock; TokenService = tokenService; diff --git a/src/IdentityServer4/src/ResponseHandling/Default/TokenRevocationResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/TokenRevocationResponseGenerator.cs index 4ad16aecd..30ec28a54 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/TokenRevocationResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/TokenRevocationResponseGenerator.cs @@ -3,16 +3,16 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; -using IdentityServer4.Stores; +using ForgePoint.Identity.Validation; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Logging; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Default revocation response generator /// - /// + /// public class TokenRevocationResponseGenerator : ITokenRevocationResponseGenerator { /// diff --git a/src/IdentityServer4/src/ResponseHandling/Default/UserInfoResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/Default/UserInfoResponseGenerator.cs index 375ff1f7c..ac24ddd3f 100644 --- a/src/IdentityServer4/src/ResponseHandling/Default/UserInfoResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/Default/UserInfoResponseGenerator.cs @@ -3,11 +3,11 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -15,12 +15,12 @@ using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// The userinfo response generator /// - /// + /// public class UserInfoResponseGenerator : IUserInfoResponseGenerator { /// diff --git a/src/IdentityServer4/src/ResponseHandling/IAuthorizeInteractionResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/IAuthorizeInteractionResponseGenerator.cs index 79d289351..7549de479 100644 --- a/src/IdentityServer4/src/ResponseHandling/IAuthorizeInteractionResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/IAuthorizeInteractionResponseGenerator.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for determining if user must login or consent when making requests to the authorization endpoint. diff --git a/src/IdentityServer4/src/ResponseHandling/IAuthorizeResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/IAuthorizeResponseGenerator.cs index fa3c88f64..75418f46b 100644 --- a/src/IdentityServer4/src/ResponseHandling/IAuthorizeResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/IAuthorizeResponseGenerator.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for the authorize response generator diff --git a/src/IdentityServer4/src/ResponseHandling/IDeviceAuthorizationResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/IDeviceAuthorizationResponseGenerator.cs index 6bb72e9cc..51f46abb1 100644 --- a/src/IdentityServer4/src/ResponseHandling/IDeviceAuthorizationResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/IDeviceAuthorizationResponseGenerator.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for the device authorization response generator diff --git a/src/IdentityServer4/src/ResponseHandling/IDiscoveryResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/IDiscoveryResponseGenerator.cs index 31e647ce2..f00a62c8d 100644 --- a/src/IdentityServer4/src/ResponseHandling/IDiscoveryResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/IDiscoveryResponseGenerator.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for discovery endpoint response generator diff --git a/src/IdentityServer4/src/ResponseHandling/IIntrospectionResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/IIntrospectionResponseGenerator.cs index 7352983ac..6adfb147a 100644 --- a/src/IdentityServer4/src/ResponseHandling/IIntrospectionResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/IIntrospectionResponseGenerator.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for introspection response generator diff --git a/src/IdentityServer4/src/ResponseHandling/ITokenResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/ITokenResponseGenerator.cs index 390212f8c..61ddd01bf 100644 --- a/src/IdentityServer4/src/ResponseHandling/ITokenResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/ITokenResponseGenerator.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface the token response generator diff --git a/src/IdentityServer4/src/ResponseHandling/ITokenRevocationResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/ITokenRevocationResponseGenerator.cs index b00628751..93e1ff44c 100644 --- a/src/IdentityServer4/src/ResponseHandling/ITokenRevocationResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/ITokenRevocationResponseGenerator.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for the userinfo response generator diff --git a/src/IdentityServer4/src/ResponseHandling/IUserInfoResponseGenerator.cs b/src/IdentityServer4/src/ResponseHandling/IUserInfoResponseGenerator.cs index c58efb732..55f558d11 100644 --- a/src/IdentityServer4/src/ResponseHandling/IUserInfoResponseGenerator.cs +++ b/src/IdentityServer4/src/ResponseHandling/IUserInfoResponseGenerator.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Interface for the userinfo response generator diff --git a/src/IdentityServer4/src/ResponseHandling/Models/AuthorizeResponse.cs b/src/IdentityServer4/src/ResponseHandling/Models/AuthorizeResponse.cs index 40e825e98..132432f8e 100644 --- a/src/IdentityServer4/src/ResponseHandling/Models/AuthorizeResponse.cs +++ b/src/IdentityServer4/src/ResponseHandling/Models/AuthorizeResponse.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; #pragma warning disable 1591 -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { public class AuthorizeResponse { diff --git a/src/IdentityServer4/src/ResponseHandling/Models/DeviceAuthorizationResponse.cs b/src/IdentityServer4/src/ResponseHandling/Models/DeviceAuthorizationResponse.cs index b900abdb7..56036361a 100644 --- a/src/IdentityServer4/src/ResponseHandling/Models/DeviceAuthorizationResponse.cs +++ b/src/IdentityServer4/src/ResponseHandling/Models/DeviceAuthorizationResponse.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { public class DeviceAuthorizationResponse { diff --git a/src/IdentityServer4/src/ResponseHandling/Models/InteractionResponse.cs b/src/IdentityServer4/src/ResponseHandling/Models/InteractionResponse.cs index c4f64cfe5..d911cdae0 100644 --- a/src/IdentityServer4/src/ResponseHandling/Models/InteractionResponse.cs +++ b/src/IdentityServer4/src/ResponseHandling/Models/InteractionResponse.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Indicates interaction outcome for user on authorization endpoint. diff --git a/src/IdentityServer4/src/ResponseHandling/Models/TokenErrorResponse.cs b/src/IdentityServer4/src/ResponseHandling/Models/TokenErrorResponse.cs index 5e5e1b232..0369fec5f 100644 --- a/src/IdentityServer4/src/ResponseHandling/Models/TokenErrorResponse.cs +++ b/src/IdentityServer4/src/ResponseHandling/Models/TokenErrorResponse.cs @@ -5,7 +5,7 @@ using IdentityModel; using System.Collections.Generic; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Models a token error response diff --git a/src/IdentityServer4/src/ResponseHandling/Models/TokenResponse.cs b/src/IdentityServer4/src/ResponseHandling/Models/TokenResponse.cs index cb2fcaafa..ca7ffad67 100644 --- a/src/IdentityServer4/src/ResponseHandling/Models/TokenResponse.cs +++ b/src/IdentityServer4/src/ResponseHandling/Models/TokenResponse.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Models a token response diff --git a/src/IdentityServer4/src/ResponseHandling/Models/TokenRevocationResponse.cs b/src/IdentityServer4/src/ResponseHandling/Models/TokenRevocationResponse.cs index 5ef1da135..6749dd070 100644 --- a/src/IdentityServer4/src/ResponseHandling/Models/TokenRevocationResponse.cs +++ b/src/IdentityServer4/src/ResponseHandling/Models/TokenRevocationResponse.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.ResponseHandling +namespace ForgePoint.Identity.ResponseHandling { /// /// Models a token revocation response diff --git a/src/IdentityServer4/src/Services/Default/BackChannelLogoutHttpClient.cs b/src/IdentityServer4/src/Services/Default/BackChannelLogoutHttpClient.cs index ed3fb5840..fd32f4ead 100644 --- a/src/IdentityServer4/src/Services/Default/BackChannelLogoutHttpClient.cs +++ b/src/IdentityServer4/src/Services/Default/BackChannelLogoutHttpClient.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Models making HTTP requests for back-channel logout notification. diff --git a/src/IdentityServer4/src/Services/Default/DefaultBackChannelLogoutService.cs b/src/IdentityServer4/src/Services/Default/DefaultBackChannelLogoutService.cs index 09ce783c8..9f8cd6445 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultBackChannelLogoutService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultBackChannelLogoutService.cs @@ -8,11 +8,12 @@ using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default back-channel logout notification implementation. @@ -27,7 +28,7 @@ public class DefaultBackChannelLogoutService : IBackChannelLogoutService /// /// The system clock; /// - protected ISystemClock Clock { get; } + protected IClock Clock { get; } /// /// The IdentityServerTools used to create and the JWT. @@ -58,7 +59,7 @@ public class DefaultBackChannelLogoutService : IBackChannelLogoutService /// /// public DefaultBackChannelLogoutService( - ISystemClock clock, + IClock clock, IdentityServerTools tools, ILogoutNotificationService logoutNotificationService, IBackChannelLogoutHttpClient backChannelLogoutHttpClient, diff --git a/src/IdentityServer4/src/Services/Default/DefaultCache.cs b/src/IdentityServer4/src/Services/Default/DefaultCache.cs index 77478860a..989acf292 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultCache.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultCache.cs @@ -6,13 +6,13 @@ using Microsoft.Extensions.Caching.Memory; using System; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// IMemoryCache-based implementation of the cache /// /// - /// + /// public class DefaultCache : ICache where T : class { diff --git a/src/IdentityServer4/src/Services/Default/DefaultClaimsService.cs b/src/IdentityServer4/src/Services/Default/DefaultClaimsService.cs index 9ce46ab76..37a70d6d0 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultClaimsService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultClaimsService.cs @@ -3,16 +3,16 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default claims provider implementation diff --git a/src/IdentityServer4/src/Services/Default/DefaultConsentService.cs b/src/IdentityServer4/src/Services/Default/DefaultConsentService.cs index 0753f1f10..6b1e418c7 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultConsentService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultConsentService.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using System; using System.Collections.Generic; using System.Linq; @@ -12,9 +12,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default consent service @@ -29,7 +30,7 @@ public class DefaultConsentService : IConsentService /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// The logger @@ -43,7 +44,7 @@ public class DefaultConsentService : IConsentService /// The user consent store. /// The logger. /// store - public DefaultConsentService(ISystemClock clock, IUserConsentStore userConsentStore, ILogger logger) + public DefaultConsentService(IClock clock, IUserConsentStore userConsentStore, ILogger logger) { Clock = clock; UserConsentStore = userConsentStore; diff --git a/src/IdentityServer4/src/Services/Default/DefaultCorsPolicyService.cs b/src/IdentityServer4/src/Services/Default/DefaultCorsPolicyService.cs index be17fd126..668739c78 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultCorsPolicyService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultCorsPolicyService.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default CORS policy service. diff --git a/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowCodeService.cs b/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowCodeService.cs index bc589c040..e72997b8f 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowCodeService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowCodeService.cs @@ -1,13 +1,13 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; -namespace IdentityServer4.Services.Default +namespace ForgePoint.Identity.Services.Default { /// /// Default wrapper service for IDeviceFlowStore, handling key hashing /// - /// + /// public class DefaultDeviceFlowCodeService : IDeviceFlowCodeService { private readonly IDeviceFlowStore _store; diff --git a/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowInteractionService.cs b/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowInteractionService.cs index 72cbcfdab..90f64a7c4 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowInteractionService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultDeviceFlowInteractionService.cs @@ -4,12 +4,12 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { internal class DefaultDeviceFlowInteractionService : IDeviceFlowInteractionService { diff --git a/src/IdentityServer4/src/Services/Default/DefaultEventService.cs b/src/IdentityServer4/src/Services/Default/DefaultEventService.cs index 33a265b68..987dfb31b 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultEventService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultEventService.cs @@ -5,17 +5,18 @@ using System; using System.Diagnostics; using Microsoft.AspNetCore.Http; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Events +namespace ForgePoint.Identity.Events { /// /// The default event service /// - /// + /// public class DefaultEventService : IEventService { /// @@ -36,7 +37,7 @@ public class DefaultEventService : IEventService /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// Initializes a new instance of the class. @@ -45,7 +46,7 @@ public class DefaultEventService : IEventService /// The context. /// The sink. /// The clock. - public DefaultEventService(IdentityServerOptions options, IHttpContextAccessor context, IEventSink sink, ISystemClock clock) + public DefaultEventService(IdentityServerOptions options, IHttpContextAccessor context, IEventSink sink, IClock clock) { Options = options; Context = context; diff --git a/src/IdentityServer4/src/Services/Default/DefaultEventSink.cs b/src/IdentityServer4/src/Services/Default/DefaultEventSink.cs index 428ddfa28..60b41885c 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultEventSink.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultEventSink.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; +using ForgePoint.Identity.Events; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default implementation of the event service. Write events raised to the log. diff --git a/src/IdentityServer4/src/Services/Default/DefaultHandleGenerationService.cs b/src/IdentityServer4/src/Services/Default/DefaultHandleGenerationService.cs index ec81caf42..6b9c55620 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultHandleGenerationService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultHandleGenerationService.cs @@ -5,12 +5,12 @@ using IdentityModel; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default handle generation service /// - /// + /// public class DefaultHandleGenerationService : IHandleGenerationService { /// diff --git a/src/IdentityServer4/src/Services/Default/DefaultIdentityServerInteractionService.cs b/src/IdentityServer4/src/Services/Default/DefaultIdentityServerInteractionService.cs index 7b86309c6..5f4977656 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultIdentityServerInteractionService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultIdentityServerInteractionService.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Http; using System; using System.Threading.Tasks; @@ -12,12 +12,13 @@ using Microsoft.Extensions.Logging; using System.Linq; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { internal class DefaultIdentityServerInteractionService : IIdentityServerInteractionService { - private readonly ISystemClock _clock; + private readonly IClock _clock; private readonly IHttpContextAccessor _context; private readonly IMessageStore _logoutMessageStore; private readonly IMessageStore _errorMessageStore; @@ -28,7 +29,7 @@ internal class DefaultIdentityServerInteractionService : IIdentityServerInteract private readonly ReturnUrlParser _returnUrlParser; public DefaultIdentityServerInteractionService( - ISystemClock clock, + IClock clock, IHttpContextAccessor context, IMessageStore logoutMessageStore, IMessageStore errorMessageStore, diff --git a/src/IdentityServer4/src/Services/Default/DefaultJwtRequestUriHttpClient.cs b/src/IdentityServer4/src/Services/Default/DefaultJwtRequestUriHttpClient.cs index e816f1b35..334d7f828 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultJwtRequestUriHttpClient.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultJwtRequestUriHttpClient.cs @@ -3,14 +3,14 @@ using System; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System.Net.Http; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default JwtRequest client diff --git a/src/IdentityServer4/src/Services/Default/DefaultKeyMaterialService.cs b/src/IdentityServer4/src/Services/Default/DefaultKeyMaterialService.cs index a7590dc7a..10a454ded 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultKeyMaterialService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultKeyMaterialService.cs @@ -5,18 +5,18 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.IdentityModel.Tokens; -using IdentityServer4.Stores; -using IdentityServer4.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Models; using System.Linq; using System; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// The default key material service /// - /// + /// public class DefaultKeyMaterialService : IKeyMaterialService { private readonly IEnumerable _signingCredentialStores; diff --git a/src/IdentityServer4/src/Services/Default/DefaultPersistedGrantService.cs b/src/IdentityServer4/src/Services/Default/DefaultPersistedGrantService.cs index 3a4d4a496..91ec267a6 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultPersistedGrantService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultPersistedGrantService.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System.Threading.Tasks; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; using System.Collections.Generic; using System.Linq; using System; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default persisted grant service diff --git a/src/IdentityServer4/src/Services/Default/DefaultProfileService.cs b/src/IdentityServer4/src/Services/Default/DefaultProfileService.cs index cb8771d00..009d34613 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultProfileService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultProfileService.cs @@ -3,16 +3,16 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default profile service implementation. /// This implementation sources all claims from the current subject (e.g. the cookie). /// - /// + /// public class DefaultProfileService : IProfileService { /// diff --git a/src/IdentityServer4/src/Services/Default/DefaultRefreshTokenService.cs b/src/IdentityServer4/src/Services/Default/DefaultRefreshTokenService.cs index af2c2c33c..84e23cac4 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultRefreshTokenService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultRefreshTokenService.cs @@ -2,18 +2,19 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Logging; using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Logging.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Logging.Models; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default refresh token service @@ -38,7 +39,7 @@ public class DefaultRefreshTokenService : IRefreshTokenService /// /// The clock /// - protected ISystemClock Clock { get; } + protected IClock Clock { get; } /// /// Initializes a new instance of the class. @@ -48,7 +49,7 @@ public class DefaultRefreshTokenService : IRefreshTokenService /// The clock /// The logger public DefaultRefreshTokenService(IRefreshTokenStore refreshTokenStore, IProfileService profile, - ISystemClock clock, + IClock clock, ILogger logger) { RefreshTokenStore = refreshTokenStore; diff --git a/src/IdentityServer4/src/Services/Default/DefaultReplayCache.cs b/src/IdentityServer4/src/Services/Default/DefaultReplayCache.cs index 90b6452be..3a07291ba 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultReplayCache.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultReplayCache.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default implementation of the replay cache using IDistributedCache diff --git a/src/IdentityServer4/src/Services/Default/DefaultTokenCreationService.cs b/src/IdentityServer4/src/Services/Default/DefaultTokenCreationService.cs index 8ac48388c..f5f0c7ef2 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultTokenCreationService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultTokenCreationService.cs @@ -3,9 +3,9 @@ using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Tokens; @@ -13,9 +13,10 @@ using System.Globalization; using System.IdentityModel.Tokens.Jwt; using System.Threading.Tasks; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default token creation service @@ -35,7 +36,7 @@ public class DefaultTokenCreationService : ITokenCreationService /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// The options @@ -50,7 +51,7 @@ public class DefaultTokenCreationService : ITokenCreationService /// The options. /// The logger. public DefaultTokenCreationService( - ISystemClock clock, + IClock clock, IKeyMaterialService keys, IdentityServerOptions options, ILogger logger) diff --git a/src/IdentityServer4/src/Services/Default/DefaultTokenService.cs b/src/IdentityServer4/src/Services/Default/DefaultTokenService.cs index 628f571b9..37362f780 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultTokenService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultTokenService.cs @@ -3,10 +3,10 @@ using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; @@ -15,8 +15,9 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default token service @@ -51,7 +52,7 @@ public class DefaultTokenService : ITokenService /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// The key material service @@ -79,7 +80,7 @@ public DefaultTokenService( IReferenceTokenStore referenceTokenStore, ITokenCreationService creationService, IHttpContextAccessor contextAccessor, - ISystemClock clock, + IClock clock, IKeyMaterialService keyMaterialService, IdentityServerOptions options, ILogger logger) diff --git a/src/IdentityServer4/src/Services/Default/DefaultUserCodeService.cs b/src/IdentityServer4/src/Services/Default/DefaultUserCodeService.cs index ee115f192..422ed06ed 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultUserCodeService.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultUserCodeService.cs @@ -7,12 +7,12 @@ using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default user code service implementation. /// - /// + /// public class DefaultUserCodeService : IUserCodeService { private readonly IEnumerable _generators; diff --git a/src/IdentityServer4/src/Services/Default/DefaultUserSession.cs b/src/IdentityServer4/src/Services/Default/DefaultUserSession.cs index ea92aa28b..e9716cfef 100644 --- a/src/IdentityServer4/src/Services/Default/DefaultUserSession.cs +++ b/src/IdentityServer4/src/Services/Default/DefaultUserSession.cs @@ -4,18 +4,19 @@ using System.Security.Claims; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Cookie-based session implementation /// - /// + /// public class DefaultUserSession : IUserSession { /// @@ -36,7 +37,7 @@ public class DefaultUserSession : IUserSession /// /// The clock /// - protected readonly ISystemClock Clock; + protected readonly IClock Clock; /// /// The logger @@ -97,7 +98,7 @@ public DefaultUserSession( IHttpContextAccessor httpContextAccessor, IAuthenticationHandlerProvider handlers, IdentityServerOptions options, - ISystemClock clock, + IClock clock, ILogger logger) { HttpContextAccessor = httpContextAccessor; diff --git a/src/IdentityServer4/src/Services/Default/DistributedDeviceFlowThrottlingService.cs b/src/IdentityServer4/src/Services/Default/DistributedDeviceFlowThrottlingService.cs index 334e35657..d8ad56289 100644 --- a/src/IdentityServer4/src/Services/Default/DistributedDeviceFlowThrottlingService.cs +++ b/src/IdentityServer4/src/Services/Default/DistributedDeviceFlowThrottlingService.cs @@ -4,21 +4,22 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Caching.Distributed; +using ForgePoint.Identity; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// The default device flow throttling service using IDistributedCache. /// - /// + /// public class DistributedDeviceFlowThrottlingService : IDeviceFlowThrottlingService { private readonly IDistributedCache _cache; - private readonly ISystemClock _clock; + private readonly IClock _clock; private readonly IdentityServerOptions _options; private const string KeyPrefix = "devicecode_"; @@ -31,7 +32,7 @@ public class DistributedDeviceFlowThrottlingService : IDeviceFlowThrottlingServi /// The options. public DistributedDeviceFlowThrottlingService( IDistributedCache cache, - ISystemClock clock, + IClock clock, IdentityServerOptions options) { _cache = cache; diff --git a/src/IdentityServer4/src/Services/Default/LogoutNotificationService.cs b/src/IdentityServer4/src/Services/Default/LogoutNotificationService.cs index a922fceb2..c73c847d1 100644 --- a/src/IdentityServer4/src/Services/Default/LogoutNotificationService.cs +++ b/src/IdentityServer4/src/Services/Default/LogoutNotificationService.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Default implementation of logout notification service. diff --git a/src/IdentityServer4/src/Services/Default/NumericUserCodeGenerator.cs b/src/IdentityServer4/src/Services/Default/NumericUserCodeGenerator.cs index e52f62d66..e619c5628 100644 --- a/src/IdentityServer4/src/Services/Default/NumericUserCodeGenerator.cs +++ b/src/IdentityServer4/src/Services/Default/NumericUserCodeGenerator.cs @@ -6,12 +6,12 @@ using System.Security.Cryptography; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// User code generator using 9 digit number /// - /// + /// public class NumericUserCodeGenerator : IUserCodeGenerator { /// diff --git a/src/IdentityServer4/src/Services/Default/OidcReturnUrlParser.cs b/src/IdentityServer4/src/Services/Default/OidcReturnUrlParser.cs index 474e94650..857dac83f 100644 --- a/src/IdentityServer4/src/Services/Default/OidcReturnUrlParser.cs +++ b/src/IdentityServer4/src/Services/Default/OidcReturnUrlParser.cs @@ -4,14 +4,14 @@ using System; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Extensions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; -using IdentityServer4.Stores; +using ForgePoint.Identity.Stores; using System.Collections.Specialized; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { internal class OidcReturnUrlParser : IReturnUrlParser { diff --git a/src/IdentityServer4/src/Services/Default/ReturnUrlParser.cs b/src/IdentityServer4/src/Services/Default/ReturnUrlParser.cs index d4ed225ad..cf2a5e9d3 100644 --- a/src/IdentityServer4/src/Services/Default/ReturnUrlParser.cs +++ b/src/IdentityServer4/src/Services/Default/ReturnUrlParser.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Parses a return URL using all registered URL parsers diff --git a/src/IdentityServer4/src/Services/IBackChannelLogoutHttpClient.cs b/src/IdentityServer4/src/Services/IBackChannelLogoutHttpClient.cs index 0242bfbf6..87985b1d8 100644 --- a/src/IdentityServer4/src/Services/IBackChannelLogoutHttpClient.cs +++ b/src/IdentityServer4/src/Services/IBackChannelLogoutHttpClient.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Models making HTTP requests for back-channel logout notification. diff --git a/src/IdentityServer4/src/Services/IBackChannelLogoutService.cs b/src/IdentityServer4/src/Services/IBackChannelLogoutService.cs index dae6b6d7a..89c00b888 100644 --- a/src/IdentityServer4/src/Services/IBackChannelLogoutService.cs +++ b/src/IdentityServer4/src/Services/IBackChannelLogoutService.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// The service responsible for performing back-channel logout notification. diff --git a/src/IdentityServer4/src/Services/ICache.cs b/src/IdentityServer4/src/Services/ICache.cs index 865dc6cb8..16214396d 100644 --- a/src/IdentityServer4/src/Services/ICache.cs +++ b/src/IdentityServer4/src/Services/ICache.cs @@ -5,7 +5,7 @@ using System; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Abstract interface to model data caching diff --git a/src/IdentityServer4/src/Services/IClaimsService.cs b/src/IdentityServer4/src/Services/IClaimsService.cs index 858aa3624..090d2398e 100644 --- a/src/IdentityServer4/src/Services/IClaimsService.cs +++ b/src/IdentityServer4/src/Services/IClaimsService.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// The claims service is responsible for determining which claims to include in tokens diff --git a/src/IdentityServer4/src/Services/IConsentService.cs b/src/IdentityServer4/src/Services/IConsentService.cs index 6c8ccd5dd..6f1005716 100644 --- a/src/IdentityServer4/src/Services/IConsentService.cs +++ b/src/IdentityServer4/src/Services/IConsentService.cs @@ -2,13 +2,13 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Service to retrieve and update consent. diff --git a/src/IdentityServer4/src/Services/IDeviceFlowCodeService.cs b/src/IdentityServer4/src/Services/IDeviceFlowCodeService.cs index 70f6e2f9d..a613c1388 100644 --- a/src/IdentityServer4/src/Services/IDeviceFlowCodeService.cs +++ b/src/IdentityServer4/src/Services/IDeviceFlowCodeService.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Wrapper service for IDeviceFlowStore. diff --git a/src/IdentityServer4/src/Services/IDeviceFlowInteractionService.cs b/src/IdentityServer4/src/Services/IDeviceFlowInteractionService.cs index 150963881..3f20e9a99 100644 --- a/src/IdentityServer4/src/Services/IDeviceFlowInteractionService.cs +++ b/src/IdentityServer4/src/Services/IDeviceFlowInteractionService.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Provide services be used by the user interface to communicate with IdentityServer. diff --git a/src/IdentityServer4/src/Services/IDeviceFlowThrottlingService.cs b/src/IdentityServer4/src/Services/IDeviceFlowThrottlingService.cs index 8de842ac6..f84389dca 100644 --- a/src/IdentityServer4/src/Services/IDeviceFlowThrottlingService.cs +++ b/src/IdentityServer4/src/Services/IDeviceFlowThrottlingService.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// The device flow throttling service. diff --git a/src/IdentityServer4/src/Services/IEventService.cs b/src/IdentityServer4/src/Services/IEventService.cs index b792acbc5..be6620f12 100644 --- a/src/IdentityServer4/src/Services/IEventService.cs +++ b/src/IdentityServer4/src/Services/IEventService.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; +using ForgePoint.Identity.Events; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Interface for the event service diff --git a/src/IdentityServer4/src/Services/IEventSink.cs b/src/IdentityServer4/src/Services/IEventSink.cs index 27b40a3c5..d0dede35f 100644 --- a/src/IdentityServer4/src/Services/IEventSink.cs +++ b/src/IdentityServer4/src/Services/IEventSink.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; +using ForgePoint.Identity.Events; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Models persistence of events diff --git a/src/IdentityServer4/src/Services/IHandleGenerationService.cs b/src/IdentityServer4/src/Services/IHandleGenerationService.cs index 5c6606008..7303b902c 100644 --- a/src/IdentityServer4/src/Services/IHandleGenerationService.cs +++ b/src/IdentityServer4/src/Services/IHandleGenerationService.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Interface for the handle generation service diff --git a/src/IdentityServer4/src/Services/IIdentityServerInteractionService.cs b/src/IdentityServer4/src/Services/IIdentityServerInteractionService.cs index 6462f982d..845f0e6f3 100644 --- a/src/IdentityServer4/src/Services/IIdentityServerInteractionService.cs +++ b/src/IdentityServer4/src/Services/IIdentityServerInteractionService.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Provide services be used by the user interface to communicate with IdentityServer. diff --git a/src/IdentityServer4/src/Services/IJwtRequestUriHttpClient.cs b/src/IdentityServer4/src/Services/IJwtRequestUriHttpClient.cs index 3d3e4ae9a..64672a896 100644 --- a/src/IdentityServer4/src/Services/IJwtRequestUriHttpClient.cs +++ b/src/IdentityServer4/src/Services/IJwtRequestUriHttpClient.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Models making HTTP requests for JWTs from the authorize endpoint. diff --git a/src/IdentityServer4/src/Services/IKeyMaterialService.cs b/src/IdentityServer4/src/Services/IKeyMaterialService.cs index 5816dab2d..07bc8bff4 100644 --- a/src/IdentityServer4/src/Services/IKeyMaterialService.cs +++ b/src/IdentityServer4/src/Services/IKeyMaterialService.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.IdentityModel.Tokens; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Interface for the key material service diff --git a/src/IdentityServer4/src/Services/ILogoutNotificationService.cs b/src/IdentityServer4/src/Services/ILogoutNotificationService.cs index bf9125ade..1b8588def 100644 --- a/src/IdentityServer4/src/Services/ILogoutNotificationService.cs +++ b/src/IdentityServer4/src/Services/ILogoutNotificationService.cs @@ -1,11 +1,11 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Provides features for OIDC signout notifications. diff --git a/src/IdentityServer4/src/Services/IPersistedGrantService.cs b/src/IdentityServer4/src/Services/IPersistedGrantService.cs index 3417b7e81..f529bb41d 100644 --- a/src/IdentityServer4/src/Services/IPersistedGrantService.cs +++ b/src/IdentityServer4/src/Services/IPersistedGrantService.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Implements persisted grant logic diff --git a/src/IdentityServer4/src/Services/IProfileService.cs b/src/IdentityServer4/src/Services/IProfileService.cs index f377829d3..ad6f92b98 100644 --- a/src/IdentityServer4/src/Services/IProfileService.cs +++ b/src/IdentityServer4/src/Services/IProfileService.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// This interface allows IdentityServer to connect to your user and profile store. diff --git a/src/IdentityServer4/src/Services/IRefreshTokenService.cs b/src/IdentityServer4/src/Services/IRefreshTokenService.cs index 8a4b11d38..fb73ddc21 100644 --- a/src/IdentityServer4/src/Services/IRefreshTokenService.cs +++ b/src/IdentityServer4/src/Services/IRefreshTokenService.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Implements refresh token creation and validation diff --git a/src/IdentityServer4/src/Services/IReplayCache.cs b/src/IdentityServer4/src/Services/IReplayCache.cs index a7396542b..be833981f 100644 --- a/src/IdentityServer4/src/Services/IReplayCache.cs +++ b/src/IdentityServer4/src/Services/IReplayCache.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Interface for replay cache implementations diff --git a/src/IdentityServer4/src/Services/IReturnUrlParser.cs b/src/IdentityServer4/src/Services/IReturnUrlParser.cs index 4b77a59ec..f3550721a 100644 --- a/src/IdentityServer4/src/Services/IReturnUrlParser.cs +++ b/src/IdentityServer4/src/Services/IReturnUrlParser.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Interface for the return URL parser diff --git a/src/IdentityServer4/src/Services/ITokenCreationService.cs b/src/IdentityServer4/src/Services/ITokenCreationService.cs index 59cb05c81..863be2d47 100644 --- a/src/IdentityServer4/src/Services/ITokenCreationService.cs +++ b/src/IdentityServer4/src/Services/ITokenCreationService.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Logic for creating security tokens diff --git a/src/IdentityServer4/src/Services/ITokenService.cs b/src/IdentityServer4/src/Services/ITokenService.cs index d33f75be9..c84f2265f 100644 --- a/src/IdentityServer4/src/Services/ITokenService.cs +++ b/src/IdentityServer4/src/Services/ITokenService.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Logic for creating security tokens diff --git a/src/IdentityServer4/src/Services/IUserCodeGenerator.cs b/src/IdentityServer4/src/Services/IUserCodeGenerator.cs index e1f10076d..0b9916f27 100644 --- a/src/IdentityServer4/src/Services/IUserCodeGenerator.cs +++ b/src/IdentityServer4/src/Services/IUserCodeGenerator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Implements device flow user code generation diff --git a/src/IdentityServer4/src/Services/IUserCodeService.cs b/src/IdentityServer4/src/Services/IUserCodeService.cs index ab2e1469f..c3e88d092 100644 --- a/src/IdentityServer4/src/Services/IUserCodeService.cs +++ b/src/IdentityServer4/src/Services/IUserCodeService.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Implements user code generation diff --git a/src/IdentityServer4/src/Services/IUserSession.cs b/src/IdentityServer4/src/Services/IUserSession.cs index 6c947bb54..a4ce39b24 100644 --- a/src/IdentityServer4/src/Services/IUserSession.cs +++ b/src/IdentityServer4/src/Services/IUserSession.cs @@ -3,7 +3,7 @@ using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Models a user's authentication session diff --git a/src/IdentityServer4/src/Services/InMemory/InMemoryCorsPolicyService.cs b/src/IdentityServer4/src/Services/InMemory/InMemoryCorsPolicyService.cs index b3fdcb3fc..021633a6a 100644 --- a/src/IdentityServer4/src/Services/InMemory/InMemoryCorsPolicyService.cs +++ b/src/IdentityServer4/src/Services/InMemory/InMemoryCorsPolicyService.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// CORS policy service that configures the allowed origins from a list of clients' redirect URLs. diff --git a/src/IdentityServer4/src/Stores/Caching/CachingClientStore.cs b/src/IdentityServer4/src/Stores/Caching/CachingClientStore.cs index a1b05b787..556b68134 100644 --- a/src/IdentityServer4/src/Stores/Caching/CachingClientStore.cs +++ b/src/IdentityServer4/src/Stores/Caching/CachingClientStore.cs @@ -2,20 +2,20 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using System.Threading.Tasks; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Cache decorator for IClientStore /// /// - /// + /// public class CachingClientStore : IClientStore where T : IClientStore { diff --git a/src/IdentityServer4/src/Stores/Caching/CachingCorsPolicyService.cs b/src/IdentityServer4/src/Stores/Caching/CachingCorsPolicyService.cs index c630b9882..9e9951d60 100644 --- a/src/IdentityServer4/src/Stores/Caching/CachingCorsPolicyService.cs +++ b/src/IdentityServer4/src/Stores/Caching/CachingCorsPolicyService.cs @@ -2,18 +2,18 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Services; using System.Threading.Tasks; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Caching decorator for ICorsPolicyService /// - /// + /// public class CachingCorsPolicyService : ICorsPolicyService where T : ICorsPolicyService { diff --git a/src/IdentityServer4/src/Stores/Caching/CachingResourceStore.cs b/src/IdentityServer4/src/Stores/Caching/CachingResourceStore.cs index c4e3923d3..93a50e422 100644 --- a/src/IdentityServer4/src/Stores/Caching/CachingResourceStore.cs +++ b/src/IdentityServer4/src/Stores/Caching/CachingResourceStore.cs @@ -2,22 +2,22 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using System.Threading.Tasks; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Caching decorator for IResourceStore /// /// - /// + /// public class CachingResourceStore : IResourceStore where T : IResourceStore { diff --git a/src/IdentityServer4/src/Stores/Default/ConsentMessageStore.cs b/src/IdentityServer4/src/Stores/Default/ConsentMessageStore.cs index f697cd85c..a0934a69a 100644 --- a/src/IdentityServer4/src/Stores/Default/ConsentMessageStore.cs +++ b/src/IdentityServer4/src/Stores/Default/ConsentMessageStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { internal class ConsentMessageStore : IConsentMessageStore { diff --git a/src/IdentityServer4/src/Stores/Default/DefaultAuthorizationCodeStore.cs b/src/IdentityServer4/src/Stores/Default/DefaultAuthorizationCodeStore.cs index b2beecd5b..63e40108e 100644 --- a/src/IdentityServer4/src/Stores/Default/DefaultAuthorizationCodeStore.cs +++ b/src/IdentityServer4/src/Stores/Default/DefaultAuthorizationCodeStore.cs @@ -3,13 +3,13 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.Extensions.Logging; -using IdentityServer4.Extensions; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Services; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Default authorization code store. diff --git a/src/IdentityServer4/src/Stores/Default/DefaultGrantStore.cs b/src/IdentityServer4/src/Stores/Default/DefaultGrantStore.cs index a1a3bd21b..9a050f2f4 100644 --- a/src/IdentityServer4/src/Stores/Default/DefaultGrantStore.cs +++ b/src/IdentityServer4/src/Stores/Default/DefaultGrantStore.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Base class for persisting grants using the IPersistedGrantStore. diff --git a/src/IdentityServer4/src/Stores/Default/DefaultPushedAuthorizationStore.cs b/src/IdentityServer4/src/Stores/Default/DefaultPushedAuthorizationStore.cs new file mode 100644 index 000000000..96610f2fc --- /dev/null +++ b/src/IdentityServer4/src/Stores/Default/DefaultPushedAuthorizationStore.cs @@ -0,0 +1,98 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System; +using System.Threading.Tasks; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores.Serialization; +using Microsoft.Extensions.Logging; + +namespace ForgePoint.Identity.Stores +{ + /// + /// Default PAR store backed by . + /// + public class DefaultPushedAuthorizationStore : DefaultGrantStore, IPushedAuthorizationStore + { + private readonly IClock _clock; + private readonly IdentityServerOptions _options; + + /// + /// Initializes a new instance of the class. + /// + public DefaultPushedAuthorizationStore( + IPersistedGrantStore store, + IPersistentGrantSerializer serializer, + IHandleGenerationService handleGenerationService, + IClock clock, + IdentityServerOptions options, + ILogger logger) + : base(IdentityServerConstants.PersistedGrantTypes.PushedAuthorization, store, serializer, handleGenerationService, logger) + { + _clock = clock; + _options = options; + } + + /// + public async Task StoreAsync(PushedAuthorizationRequest request) + { + if (request == null) throw new ArgumentNullException(nameof(request)); + if (request.ClientId.IsMissing()) throw new ArgumentException("ClientId is required", nameof(request)); + + var lifetime = _options.PushedAuthorization.Lifetime; + var handle = await CreateItemAsync( + request, + request.ClientId, + subjectId: null, + sessionId: null, + description: "par", + created: _clock.UtcNow.UtcDateTime, + lifetime: lifetime); + + return Constants.PushedAuthorizationRequestUriPrefix + handle; + } + + /// + public Task GetAsync(string requestUri) + { + var handle = ExtractHandle(requestUri); + if (handle == null) + { + return Task.FromResult(null); + } + + return GetItemAsync(handle); + } + + /// + public Task RemoveAsync(string requestUri) + { + var handle = ExtractHandle(requestUri); + if (handle == null) + { + return Task.CompletedTask; + } + + return RemoveItemAsync(handle); + } + + private static string ExtractHandle(string requestUri) + { + if (requestUri.IsMissing()) + { + return null; + } + + if (!requestUri.StartsWith(Constants.PushedAuthorizationRequestUriPrefix, StringComparison.Ordinal)) + { + return null; + } + + return requestUri.Substring(Constants.PushedAuthorizationRequestUriPrefix.Length); + } + } +} diff --git a/src/IdentityServer4/src/Stores/Default/DefaultReferenceTokenStore.cs b/src/IdentityServer4/src/Stores/Default/DefaultReferenceTokenStore.cs index bb35f1711..340e242eb 100644 --- a/src/IdentityServer4/src/Stores/Default/DefaultReferenceTokenStore.cs +++ b/src/IdentityServer4/src/Stores/Default/DefaultReferenceTokenStore.cs @@ -3,12 +3,12 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.Extensions.Logging; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Default reference token store. diff --git a/src/IdentityServer4/src/Stores/Default/DefaultRefreshTokenStore.cs b/src/IdentityServer4/src/Stores/Default/DefaultRefreshTokenStore.cs index f564a9d14..d3af1d304 100644 --- a/src/IdentityServer4/src/Stores/Default/DefaultRefreshTokenStore.cs +++ b/src/IdentityServer4/src/Stores/Default/DefaultRefreshTokenStore.cs @@ -3,12 +3,12 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.Extensions.Logging; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Default refresh token store. diff --git a/src/IdentityServer4/src/Stores/Default/DefaultUserConsentStore.cs b/src/IdentityServer4/src/Stores/Default/DefaultUserConsentStore.cs index e95eb438e..dfd47a0da 100644 --- a/src/IdentityServer4/src/Stores/Default/DefaultUserConsentStore.cs +++ b/src/IdentityServer4/src/Stores/Default/DefaultUserConsentStore.cs @@ -3,12 +3,12 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores.Serialization; using Microsoft.Extensions.Logging; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Default user consent store. diff --git a/src/IdentityServer4/src/Stores/Default/DistributedCacheAuthorizationParametersMessageStore.cs b/src/IdentityServer4/src/Stores/Default/DistributedCacheAuthorizationParametersMessageStore.cs index 25d1a478f..8cfcbdd21 100644 --- a/src/IdentityServer4/src/Stores/Default/DistributedCacheAuthorizationParametersMessageStore.cs +++ b/src/IdentityServer4/src/Stores/Default/DistributedCacheAuthorizationParametersMessageStore.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Caching.Distributed; -namespace IdentityServer4.Stores.Default +namespace ForgePoint.Identity.Stores.Default { /// /// Implementation of IAuthorizationParametersMessageStore that uses the IDistributedCache. diff --git a/src/IdentityServer4/src/Stores/Default/ProtectedDataMessageStore.cs b/src/IdentityServer4/src/Stores/Default/ProtectedDataMessageStore.cs index 0fd5ad77a..85a577c44 100644 --- a/src/IdentityServer4/src/Stores/Default/ProtectedDataMessageStore.cs +++ b/src/IdentityServer4/src/Stores/Default/ProtectedDataMessageStore.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; using Microsoft.AspNetCore.DataProtection; using IdentityModel; @@ -10,7 +10,7 @@ using System; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// IMessageStore implementation that uses data protection to protect message. @@ -18,7 +18,7 @@ namespace IdentityServer4.Stores /// public class ProtectedDataMessageStore : IMessageStore { - private const string Purpose = "IdentityServer4.Stores.ProtectedDataMessageStore"; + private const string Purpose = "ForgePoint.Identity.Stores.ProtectedDataMessageStore"; /// /// The data protector. diff --git a/src/IdentityServer4/src/Stores/Default/QueryStringAuthorizationParametersMessageStore.cs b/src/IdentityServer4/src/Stores/Default/QueryStringAuthorizationParametersMessageStore.cs index 386282a8c..9c0f3dd46 100644 --- a/src/IdentityServer4/src/Stores/Default/QueryStringAuthorizationParametersMessageStore.cs +++ b/src/IdentityServer4/src/Stores/Default/QueryStringAuthorizationParametersMessageStore.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { // internal just for testing internal class QueryStringAuthorizationParametersMessageStore : IAuthorizationParametersMessageStore diff --git a/src/IdentityServer4/src/Stores/IAuthorizationParametersMessageStore.cs b/src/IdentityServer4/src/Stores/IAuthorizationParametersMessageStore.cs index b4f65a08a..0a2008be4 100644 --- a/src/IdentityServer4/src/Stores/IAuthorizationParametersMessageStore.cs +++ b/src/IdentityServer4/src/Stores/IAuthorizationParametersMessageStore.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for authorization request messages that are sent from the authorization endpoint to the login and consent UI. diff --git a/src/IdentityServer4/src/Stores/IConsentMessageStore.cs b/src/IdentityServer4/src/Stores/IConsentMessageStore.cs index 034f34cff..3c8a97f83 100644 --- a/src/IdentityServer4/src/Stores/IConsentMessageStore.cs +++ b/src/IdentityServer4/src/Stores/IConsentMessageStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for consent messages that are sent from the consent UI to the authorization endpoint. diff --git a/src/IdentityServer4/src/Stores/IMessageStore.cs b/src/IdentityServer4/src/Stores/IMessageStore.cs index 5ea8b7740..b8f8baf97 100644 --- a/src/IdentityServer4/src/Stores/IMessageStore.cs +++ b/src/IdentityServer4/src/Stores/IMessageStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for a message store diff --git a/src/IdentityServer4/src/Stores/IPushedAuthorizationStore.cs b/src/IdentityServer4/src/Stores/IPushedAuthorizationStore.cs new file mode 100644 index 000000000..9a079fc97 --- /dev/null +++ b/src/IdentityServer4/src/Stores/IPushedAuthorizationStore.cs @@ -0,0 +1,34 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Threading.Tasks; +using ForgePoint.Identity.Models; + +namespace ForgePoint.Identity.Stores +{ + /// + /// Persistence for OAuth 2.0 Pushed Authorization Requests (RFC 9126). + /// + public interface IPushedAuthorizationStore + { + /// + /// Stores a pushed authorization request and returns the request_uri. + /// + /// The request to store. + /// The request_uri bound to this request. + Task StoreAsync(PushedAuthorizationRequest request); + + /// + /// Loads a previously pushed authorization request. + /// + /// The request_uri returned from . + Task GetAsync(string requestUri); + + /// + /// Removes a pushed authorization request (PAR requests are single-use). + /// + /// The request_uri to remove. + Task RemoveAsync(string requestUri); + } +} diff --git a/src/IdentityServer4/src/Stores/ISigningCredentialStore.cs b/src/IdentityServer4/src/Stores/ISigningCredentialStore.cs index 82f60572b..8a179743b 100644 --- a/src/IdentityServer4/src/Stores/ISigningCredentialStore.cs +++ b/src/IdentityServer4/src/Stores/ISigningCredentialStore.cs @@ -5,7 +5,7 @@ using Microsoft.IdentityModel.Tokens; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for a signing credential store diff --git a/src/IdentityServer4/src/Stores/IValidationKeysStore.cs b/src/IdentityServer4/src/Stores/IValidationKeysStore.cs index e9e8af655..df3172873 100644 --- a/src/IdentityServer4/src/Stores/IValidationKeysStore.cs +++ b/src/IdentityServer4/src/Stores/IValidationKeysStore.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for the validation key store diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemoryClientStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemoryClientStore.cs index a4e584420..b809e1526 100644 --- a/src/IdentityServer4/src/Stores/InMemory/InMemoryClientStore.cs +++ b/src/IdentityServer4/src/Stores/InMemory/InMemoryClientStore.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// In-memory client store diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemoryDeviceFlowStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemoryDeviceFlowStore.cs index 2b97237cf..299c7d03b 100644 --- a/src/IdentityServer4/src/Stores/InMemory/InMemoryDeviceFlowStore.cs +++ b/src/IdentityServer4/src/Stores/InMemory/InMemoryDeviceFlowStore.cs @@ -5,14 +5,14 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// In-memory device flow store /// - /// + /// public class InMemoryDeviceFlowStore : IDeviceFlowStore { private readonly List _repository = new List(); diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemoryPersistedGrantStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemoryPersistedGrantStore.cs index 555f97969..9e7583671 100644 --- a/src/IdentityServer4/src/Stores/InMemory/InMemoryPersistedGrantStore.cs +++ b/src/IdentityServer4/src/Stores/InMemory/InMemoryPersistedGrantStore.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using System.Collections.Concurrent; using System.Linq; using System.Threading.Tasks; using System.Collections.Generic; using System; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// In-memory persisted grant store diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemoryPushedAuthorizationStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemoryPushedAuthorizationStore.cs new file mode 100644 index 000000000..3f74a943c --- /dev/null +++ b/src/IdentityServer4/src/Stores/InMemory/InMemoryPushedAuthorizationStore.cs @@ -0,0 +1,87 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System; +using System.Collections.Concurrent; +using System.Threading.Tasks; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; + +namespace ForgePoint.Identity.Stores +{ + /// + /// In-memory store for pushed authorization requests. Intended for tests and development. + /// + public class InMemoryPushedAuthorizationStore : IPushedAuthorizationStore + { + private readonly ConcurrentDictionary _items = + new ConcurrentDictionary(); + + private readonly IHandleGenerationService _handles; + private readonly IClock _clock; + private readonly IdentityServerOptions _options; + + /// + /// Initializes a new instance of the class. + /// + public InMemoryPushedAuthorizationStore( + IHandleGenerationService handles = null, + IClock clock = null, + IdentityServerOptions options = null) + { + _handles = handles ?? new DefaultHandleGenerationService(); + _clock = clock ?? new DefaultClock(); + _options = options ?? new IdentityServerOptions(); + } + + /// + public async Task StoreAsync(PushedAuthorizationRequest request) + { + if (request == null) throw new ArgumentNullException(nameof(request)); + + var handle = await _handles.GenerateAsync(); + var expires = _clock.UtcNow.AddSeconds(_options.PushedAuthorization.Lifetime); + _items[handle] = (request, expires); + return Constants.PushedAuthorizationRequestUriPrefix + handle; + } + + /// + public Task GetAsync(string requestUri) + { + var handle = ExtractHandle(requestUri); + if (handle != null && _items.TryGetValue(handle, out var item)) + { + if (item.Expires >= _clock.UtcNow) + { + return Task.FromResult(item.Request); + } + + _items.TryRemove(handle, out _); + } + + return Task.FromResult(null); + } + + /// + public Task RemoveAsync(string requestUri) + { + var handle = ExtractHandle(requestUri); + if (handle != null) + { + _items.TryRemove(handle, out _); + } + + return Task.CompletedTask; + } + + private static string ExtractHandle(string requestUri) + { + if (requestUri.IsMissing()) return null; + if (!requestUri.StartsWith(Constants.PushedAuthorizationRequestUriPrefix, StringComparison.Ordinal)) return null; + return requestUri.Substring(Constants.PushedAuthorizationRequestUriPrefix.Length); + } + } +} diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemoryResourcesStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemoryResourcesStore.cs index 6e2237c38..a1e33d84f 100644 --- a/src/IdentityServer4/src/Stores/InMemory/InMemoryResourcesStore.cs +++ b/src/IdentityServer4/src/Stores/InMemory/InMemoryResourcesStore.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// In-memory resource store diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemorySigningCredentialsStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemorySigningCredentialsStore.cs index 8723eb814..68a67b1a7 100644 --- a/src/IdentityServer4/src/Stores/InMemory/InMemorySigningCredentialsStore.cs +++ b/src/IdentityServer4/src/Stores/InMemory/InMemorySigningCredentialsStore.cs @@ -5,12 +5,12 @@ using Microsoft.IdentityModel.Tokens; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Default signing credentials store /// - /// + /// public class InMemorySigningCredentialsStore : ISigningCredentialStore { private readonly SigningCredentials _credential; diff --git a/src/IdentityServer4/src/Stores/InMemory/InMemoryValidationKeysStore.cs b/src/IdentityServer4/src/Stores/InMemory/InMemoryValidationKeysStore.cs index d85caa51c..3f95b9e54 100644 --- a/src/IdentityServer4/src/Stores/InMemory/InMemoryValidationKeysStore.cs +++ b/src/IdentityServer4/src/Stores/InMemory/InMemoryValidationKeysStore.cs @@ -2,17 +2,17 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// The default validation key store /// - /// + /// public class InMemoryValidationKeysStore : IValidationKeysStore { private readonly IEnumerable _keys; diff --git a/src/IdentityServer4/src/Stores/ValidatingClientStore.cs b/src/IdentityServer4/src/Stores/ValidatingClientStore.cs index c38fd8ba3..3dcf39b18 100644 --- a/src/IdentityServer4/src/Stores/ValidatingClientStore.cs +++ b/src/IdentityServer4/src/Stores/ValidatingClientStore.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Client store decorator for running runtime configuration validation checks diff --git a/src/IdentityServer4/src/Test/IdentityServerBuilderExtensions.cs b/src/IdentityServer4/src/Test/IdentityServerBuilderExtensions.cs index e23832075..fb6ef6f7e 100644 --- a/src/IdentityServer4/src/Test/IdentityServerBuilderExtensions.cs +++ b/src/IdentityServer4/src/Test/IdentityServerBuilderExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Test; +using ForgePoint.Identity.Test; using System.Collections.Generic; namespace Microsoft.Extensions.DependencyInjection diff --git a/src/IdentityServer4/src/Test/TestUser.cs b/src/IdentityServer4/src/Test/TestUser.cs index 09cb8c02d..e81303461 100644 --- a/src/IdentityServer4/src/Test/TestUser.cs +++ b/src/IdentityServer4/src/Test/TestUser.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Security.Claims; -namespace IdentityServer4.Test +namespace ForgePoint.Identity.Test { /// /// In-memory user object for testing. Not intended for modeling users in production. diff --git a/src/IdentityServer4/src/Test/TestUserProfileService.cs b/src/IdentityServer4/src/Test/TestUserProfileService.cs index fdf4e3f2e..4cb142eba 100644 --- a/src/IdentityServer4/src/Test/TestUserProfileService.cs +++ b/src/IdentityServer4/src/Test/TestUserProfileService.cs @@ -2,19 +2,19 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Test +namespace ForgePoint.Identity.Test { /// /// Profile service for test users /// - /// + /// public class TestUserProfileService : IProfileService { /// diff --git a/src/IdentityServer4/src/Test/TestUserResourceOwnerPasswordValidator.cs b/src/IdentityServer4/src/Test/TestUserResourceOwnerPasswordValidator.cs index 81a7f5eda..94f79814d 100644 --- a/src/IdentityServer4/src/Test/TestUserResourceOwnerPasswordValidator.cs +++ b/src/IdentityServer4/src/Test/TestUserResourceOwnerPasswordValidator.cs @@ -3,28 +3,29 @@ using IdentityModel; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; using System; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Test +namespace ForgePoint.Identity.Test { /// /// Resource owner password validator for test users /// - /// + /// public class TestUserResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator { private readonly TestUserStore _users; - private readonly ISystemClock _clock; + private readonly IClock _clock; /// /// Initializes a new instance of the class. /// /// The users. /// The clock. - public TestUserResourceOwnerPasswordValidator(TestUserStore users, ISystemClock clock) + public TestUserResourceOwnerPasswordValidator(TestUserStore users, IClock clock) { _users = users; _clock = clock; diff --git a/src/IdentityServer4/src/Test/TestUserStore.cs b/src/IdentityServer4/src/Test/TestUserStore.cs index 5084eb12a..c0247678a 100644 --- a/src/IdentityServer4/src/Test/TestUserStore.cs +++ b/src/IdentityServer4/src/Test/TestUserStore.cs @@ -9,7 +9,7 @@ using System.Security.Claims; using System; -namespace IdentityServer4.Test +namespace ForgePoint.Identity.Test { /// /// Store for test users diff --git a/src/IdentityServer4/src/Validation/Contexts/ClientConfigurationValidationContext.cs b/src/IdentityServer4/src/Validation/Contexts/ClientConfigurationValidationContext.cs index d16aabc21..70837d351 100644 --- a/src/IdentityServer4/src/Validation/Contexts/ClientConfigurationValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Contexts/ClientConfigurationValidationContext.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Context for client configuration validation. diff --git a/src/IdentityServer4/src/Validation/Contexts/CustomAuthorizeRequestValidationContext.cs b/src/IdentityServer4/src/Validation/Contexts/CustomAuthorizeRequestValidationContext.cs index 084e4b43f..0fb672c9c 100644 --- a/src/IdentityServer4/src/Validation/Contexts/CustomAuthorizeRequestValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Contexts/CustomAuthorizeRequestValidationContext.cs @@ -1,4 +1,4 @@ -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Context for custom authorize request validation. diff --git a/src/IdentityServer4/src/Validation/Contexts/CustomTokenRequestValidationContext.cs b/src/IdentityServer4/src/Validation/Contexts/CustomTokenRequestValidationContext.cs index ca8409e0b..ee99654b8 100644 --- a/src/IdentityServer4/src/Validation/Contexts/CustomTokenRequestValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Contexts/CustomTokenRequestValidationContext.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Context class for custom token request validation diff --git a/src/IdentityServer4/src/Validation/Contexts/ExtensionGrantValidationContext.cs b/src/IdentityServer4/src/Validation/Contexts/ExtensionGrantValidationContext.cs index ddd5ae23d..d84793b69 100644 --- a/src/IdentityServer4/src/Validation/Contexts/ExtensionGrantValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Contexts/ExtensionGrantValidationContext.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Class describing the extension grant validation context diff --git a/src/IdentityServer4/src/Validation/Contexts/ResourceOwnerPasswordValidationContext.cs b/src/IdentityServer4/src/Validation/Contexts/ResourceOwnerPasswordValidationContext.cs index 90638159c..37c03fc58 100644 --- a/src/IdentityServer4/src/Validation/Contexts/ResourceOwnerPasswordValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Contexts/ResourceOwnerPasswordValidationContext.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Class describing the resource owner password validation context diff --git a/src/IdentityServer4/src/Validation/Contexts/ResourceValidationContext.cs b/src/IdentityServer4/src/Validation/Contexts/ResourceValidationContext.cs index 79e0afd8c..5766b88d6 100644 --- a/src/IdentityServer4/src/Validation/Contexts/ResourceValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Contexts/ResourceValidationContext.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Class describing the resource validation context diff --git a/src/IdentityServer4/src/Validation/Default/ApiSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/ApiSecretValidator.cs index 3f21b0157..f1c77a4bc 100644 --- a/src/IdentityServer4/src/Validation/Default/ApiSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/ApiSecretValidator.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates API secrets using the registered secret validators and parsers diff --git a/src/IdentityServer4/src/Validation/Default/AuthorizeRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/AuthorizeRequestValidator.cs index 6fa4bb721..726b9123e 100644 --- a/src/IdentityServer4/src/Validation/Default/AuthorizeRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/AuthorizeRequestValidator.cs @@ -1,848 +1,924 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - - -using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Specialized; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using IdentityServer4.Logging.Models; - -namespace IdentityServer4.Validation -{ - internal class AuthorizeRequestValidator : IAuthorizeRequestValidator - { - private readonly IdentityServerOptions _options; - private readonly IClientStore _clients; - private readonly ICustomAuthorizeRequestValidator _customValidator; - private readonly IRedirectUriValidator _uriValidator; - private readonly IResourceValidator _resourceValidator; - private readonly IUserSession _userSession; - private readonly JwtRequestValidator _jwtRequestValidator; - private readonly IJwtRequestUriHttpClient _jwtRequestUriHttpClient; - private readonly ILogger _logger; - - private readonly ResponseTypeEqualityComparer - _responseTypeEqualityComparer = new ResponseTypeEqualityComparer(); - - public AuthorizeRequestValidator( - IdentityServerOptions options, - IClientStore clients, - ICustomAuthorizeRequestValidator customValidator, - IRedirectUriValidator uriValidator, - IResourceValidator resourceValidator, - IUserSession userSession, - JwtRequestValidator jwtRequestValidator, - IJwtRequestUriHttpClient jwtRequestUriHttpClient, - ILogger logger) - { - _options = options; - _clients = clients; - _customValidator = customValidator; - _uriValidator = uriValidator; - _resourceValidator = resourceValidator; - _jwtRequestValidator = jwtRequestValidator; - _userSession = userSession; - _jwtRequestUriHttpClient = jwtRequestUriHttpClient; - _logger = logger; - } - - public async Task ValidateAsync(NameValueCollection parameters, ClaimsPrincipal subject = null) - { - _logger.LogDebug("Start authorize request protocol validation"); - - var request = new ValidatedAuthorizeRequest - { - Options = _options, - Subject = subject ?? Principal.Anonymous, - Raw = parameters ?? throw new ArgumentNullException(nameof(parameters)) - }; - - // load client_id - // client_id must always be present on the request - var loadClientResult = await LoadClientAsync(request); - if (loadClientResult.IsError) - { - return loadClientResult; - } - - // load request object - var roLoadResult = await LoadRequestObjectAsync(request); - if (roLoadResult.IsError) - { - return roLoadResult; - } - - // validate request object - var roValidationResult = await ValidateRequestObjectAsync(request); - if (roValidationResult.IsError) - { - return roValidationResult; - } - - // validate client_id and redirect_uri - var clientResult = await ValidateClientAsync(request); - if (clientResult.IsError) - { - return clientResult; - } - - // state, response_type, response_mode - var mandatoryResult = ValidateCoreParameters(request); - if (mandatoryResult.IsError) - { - return mandatoryResult; - } - - // scope, scope restrictions and plausability - var scopeResult = await ValidateScopeAsync(request); - if (scopeResult.IsError) - { - return scopeResult; - } - - // nonce, prompt, acr_values, login_hint etc. - var optionalResult = await ValidateOptionalParametersAsync(request); - if (optionalResult.IsError) - { - return optionalResult; - } - - // custom validator - _logger.LogDebug("Calling into custom validator: {type}", _customValidator.GetType().FullName); - var context = new CustomAuthorizeRequestValidationContext - { - Result = new AuthorizeRequestValidationResult(request) - }; - await _customValidator.ValidateAsync(context); - - var customResult = context.Result; - if (customResult.IsError) - { - LogError("Error in custom validation", customResult.Error, request); - return Invalid(request, customResult.Error, customResult.ErrorDescription); - } - - _logger.LogTrace("Authorize request protocol validation successful"); - - return Valid(request); - } - - private async Task LoadRequestObjectAsync(ValidatedAuthorizeRequest request) - { - var jwtRequest = request.Raw.Get(OidcConstants.AuthorizeRequest.Request); - var jwtRequestUri = request.Raw.Get(OidcConstants.AuthorizeRequest.RequestUri); - - if (jwtRequest.IsPresent() && jwtRequestUri.IsPresent()) - { - LogError("Both request and request_uri are present", request); - return Invalid(request, description: "Only one request parameter is allowed"); - } - - if (_options.Endpoints.EnableJwtRequestUri) - { - if (jwtRequestUri.IsPresent()) - { - // 512 is from the spec - if (jwtRequestUri.Length > 512) - { - LogError("request_uri is too long", request); - return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "request_uri is too long"); - } - - var jwt = await _jwtRequestUriHttpClient.GetJwtAsync(jwtRequestUri, request.Client); - if (jwt.IsMissing()) - { - LogError("no value returned from request_uri", request); - return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "no value returned from request_uri"); - } - - jwtRequest = jwt; - } - } - else if (jwtRequestUri.IsPresent()) - { - LogError("request_uri present but config prohibits", request); - return Invalid(request, error: OidcConstants.AuthorizeErrors.RequestUriNotSupported); - } - - // check length restrictions - if (jwtRequest.IsPresent()) - { - if (jwtRequest.Length >= _options.InputLengthRestrictions.Jwt) - { - LogError("request value is too long", request); - return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestObject, description: "Invalid request value"); - } - } - - request.RequestObject = jwtRequest; - return Valid(request); - } - - private async Task LoadClientAsync(ValidatedAuthorizeRequest request) - { - ////////////////////////////////////////////////////////// - // client_id must be present - ///////////////////////////////////////////////////////// - var clientId = request.Raw.Get(OidcConstants.AuthorizeRequest.ClientId); - - if (clientId.IsMissingOrTooLong(_options.InputLengthRestrictions.ClientId)) - { - LogError("client_id is missing or too long", request); - return Invalid(request, description: "Invalid client_id"); - } - - request.ClientId = clientId; - - ////////////////////////////////////////////////////////// - // check for valid client - ////////////////////////////////////////////////////////// - var client = await _clients.FindEnabledClientByIdAsync(request.ClientId); - if (client == null) - { - LogError("Unknown client or not enabled", request.ClientId, request); - return Invalid(request, OidcConstants.AuthorizeErrors.UnauthorizedClient, "Unknown client or client not enabled"); - } - - request.SetClient(client); - - return Valid(request); - } - - private async Task ValidateRequestObjectAsync(ValidatedAuthorizeRequest request) - { - ////////////////////////////////////////////////////////// - // validate request object - ///////////////////////////////////////////////////////// - if (request.RequestObject.IsPresent()) - { - // validate the request JWT for this client - var jwtRequestValidationResult = await _jwtRequestValidator.ValidateAsync(request.Client, request.RequestObject); - if (jwtRequestValidationResult.IsError) - { - LogError("request JWT validation failure", request); - return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestObject, description: "Invalid JWT request"); - } - - // validate response_type match - var responseType = request.Raw.Get(OidcConstants.AuthorizeRequest.ResponseType); - if (responseType != null) - { - if (jwtRequestValidationResult.Payload.TryGetValue(OidcConstants.AuthorizeRequest.ResponseType, out var payloadResponseType)) - { - if (payloadResponseType != responseType) - { - LogError("response_type in JWT payload does not match response_type in request", request); - return Invalid(request, description: "Invalid JWT request"); - } - } - } - - // validate client_id mismatch - if (jwtRequestValidationResult.Payload.TryGetValue(OidcConstants.AuthorizeRequest.ClientId, out var payloadClientId)) - { - if (!string.Equals(request.Client.ClientId, payloadClientId, StringComparison.Ordinal)) - { - LogError("client_id in JWT payload does not match client_id in request", request); - return Invalid(request, description: "Invalid JWT request"); - } - } - else - { - LogError("client_id is missing in JWT payload", request); - return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestObject, description: "Invalid JWT request"); - } - - var ignoreKeys = new[] - { - JwtClaimTypes.Issuer, - JwtClaimTypes.Audience - }; - - // merge jwt payload values into original request parameters - foreach (var key in jwtRequestValidationResult.Payload.Keys) - { - if (ignoreKeys.Contains(key)) continue; - - var value = jwtRequestValidationResult.Payload[key]; - - var qsValue = request.Raw.Get(key); - if (qsValue != null) - { - if (!string.Equals(value, qsValue, StringComparison.Ordinal)) - { - LogError("parameter mismatch between request object and query string parameter.", request); - return Invalid(request, description: "Parameter mismatch in JWT request"); - } - } - - request.Raw.Set(key, value); - } - - request.RequestObjectValues = jwtRequestValidationResult.Payload; - } - - return Valid(request); - } - - private async Task ValidateClientAsync(ValidatedAuthorizeRequest request) - { - ////////////////////////////////////////////////////////// - // check request object requirement - ////////////////////////////////////////////////////////// - if (request.Client.RequireRequestObject) - { - if (!request.RequestObjectValues.Any()) - { - return Invalid(request, description: "Client must use request object, but no request or request_uri parameter present"); - } - } - - ////////////////////////////////////////////////////////// - // redirect_uri must be present, and a valid uri - ////////////////////////////////////////////////////////// - var redirectUri = request.Raw.Get(OidcConstants.AuthorizeRequest.RedirectUri); - - if (redirectUri.IsMissingOrTooLong(_options.InputLengthRestrictions.RedirectUri)) - { - LogError("redirect_uri is missing or too long", request); - return Invalid(request, description: "Invalid redirect_uri"); - } - - if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out _)) - { - LogError("malformed redirect_uri", redirectUri, request); - return Invalid(request, description: "Invalid redirect_uri"); - } - - ////////////////////////////////////////////////////////// - // check if client protocol type is oidc - ////////////////////////////////////////////////////////// - if (request.Client.ProtocolType != IdentityServerConstants.ProtocolTypes.OpenIdConnect) - { - LogError("Invalid protocol type for OIDC authorize endpoint", request.Client.ProtocolType, request); - return Invalid(request, OidcConstants.AuthorizeErrors.UnauthorizedClient, description: "Invalid protocol"); - } - - ////////////////////////////////////////////////////////// - // check if redirect_uri is valid - ////////////////////////////////////////////////////////// - if (await _uriValidator.IsRedirectUriValidAsync(redirectUri, request.Client) == false) - { - LogError("Invalid redirect_uri", redirectUri, request); - return Invalid(request, OidcConstants.AuthorizeErrors.InvalidRequest, "Invalid redirect_uri"); - } - - request.RedirectUri = redirectUri; - - return Valid(request); - } - - private AuthorizeRequestValidationResult ValidateCoreParameters(ValidatedAuthorizeRequest request) - { - ////////////////////////////////////////////////////////// - // check state - ////////////////////////////////////////////////////////// - var state = request.Raw.Get(OidcConstants.AuthorizeRequest.State); - if (state.IsPresent()) - { - request.State = state; - } - - ////////////////////////////////////////////////////////// - // response_type must be present and supported - ////////////////////////////////////////////////////////// - var responseType = request.Raw.Get(OidcConstants.AuthorizeRequest.ResponseType); - if (responseType.IsMissing()) - { - LogError("Missing response_type", request); - return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, "Missing response_type"); - } - - // The responseType may come in in an unconventional order. - // Use an IEqualityComparer that doesn't care about the order of multiple values. - // Per https://tools.ietf.org/html/rfc6749#section-3.1.1 - - // 'Extension response types MAY contain a space-delimited (%x20) list of - // values, where the order of values does not matter (e.g., response - // type "a b" is the same as "b a").' - // http://openid.net/specs/oauth-v2-multiple-response-types-1_0-03.html#terminology - - // 'If a response type contains one of more space characters (%20), it is compared - // as a space-delimited list of values in which the order of values does not matter.' - if (!Constants.SupportedResponseTypes.Contains(responseType, _responseTypeEqualityComparer)) - { - LogError("Response type not supported", responseType, request); - return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, "Response type not supported"); - } - - // Even though the responseType may have come in in an unconventional order, - // we still need the request's ResponseType property to be set to the - // conventional, supported response type. - request.ResponseType = Constants.SupportedResponseTypes.First( - supportedResponseType => _responseTypeEqualityComparer.Equals(supportedResponseType, responseType)); - - ////////////////////////////////////////////////////////// - // match response_type to grant type - ////////////////////////////////////////////////////////// - request.GrantType = Constants.ResponseTypeToGrantTypeMapping[request.ResponseType]; - - // set default response mode for flow; this is needed for any client error processing below - request.ResponseMode = Constants.AllowedResponseModesForGrantType[request.GrantType].First(); - - ////////////////////////////////////////////////////////// - // check if flow is allowed at authorize endpoint - ////////////////////////////////////////////////////////// - if (!Constants.AllowedGrantTypesForAuthorizeEndpoint.Contains(request.GrantType)) - { - LogError("Invalid grant type", request.GrantType, request); - return Invalid(request, description: "Invalid response_type"); - } - - ////////////////////////////////////////////////////////// - // check if PKCE is required and validate parameters - ////////////////////////////////////////////////////////// - if (request.GrantType == GrantType.AuthorizationCode || request.GrantType == GrantType.Hybrid) - { - _logger.LogDebug("Checking for PKCE parameters"); - - ///////////////////////////////////////////////////////////////////////////// - // validate code_challenge and code_challenge_method - ///////////////////////////////////////////////////////////////////////////// - var proofKeyResult = ValidatePkceParameters(request); - - if (proofKeyResult.IsError) - { - return proofKeyResult; - } - } - - ////////////////////////////////////////////////////////// - // check response_mode parameter and set response_mode - ////////////////////////////////////////////////////////// - - // check if response_mode parameter is present and valid - var responseMode = request.Raw.Get(OidcConstants.AuthorizeRequest.ResponseMode); - if (responseMode.IsPresent()) - { - if (Constants.SupportedResponseModes.Contains(responseMode)) - { - if (Constants.AllowedResponseModesForGrantType[request.GrantType].Contains(responseMode)) - { - request.ResponseMode = responseMode; - } - else - { - LogError("Invalid response_mode for response_type", responseMode, request); - return Invalid(request, OidcConstants.AuthorizeErrors.InvalidRequest, description: "Invalid response_mode for response_type"); - } - } - else - { - LogError("Unsupported response_mode", responseMode, request); - return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, description: "Invalid response_mode"); - } - } - - - ////////////////////////////////////////////////////////// - // check if grant type is allowed for client - ////////////////////////////////////////////////////////// - if (!request.Client.AllowedGrantTypes.Contains(request.GrantType)) - { - LogError("Invalid grant type for client", request.GrantType, request); - return Invalid(request, OidcConstants.AuthorizeErrors.UnauthorizedClient, "Invalid grant type for client"); - } - - ////////////////////////////////////////////////////////// - // check if response type contains an access token, - // and if client is allowed to request access token via browser - ////////////////////////////////////////////////////////// - var responseTypes = responseType.FromSpaceSeparatedString(); - if (responseTypes.Contains(OidcConstants.ResponseTypes.Token)) - { - if (!request.Client.AllowAccessTokensViaBrowser) - { - LogError("Client requested access token - but client is not configured to receive access tokens via browser", request); - return Invalid(request, description: "Client not configured to receive access tokens via browser"); - } - } - - return Valid(request); - } - - private AuthorizeRequestValidationResult ValidatePkceParameters(ValidatedAuthorizeRequest request) - { - var fail = Invalid(request); - - var codeChallenge = request.Raw.Get(OidcConstants.AuthorizeRequest.CodeChallenge); - if (codeChallenge.IsMissing()) - { - if (request.Client.RequirePkce) - { - LogError("code_challenge is missing", request); - fail.ErrorDescription = "code challenge required"; - } - else - { - _logger.LogDebug("No PKCE used."); - return Valid(request); - } - - return fail; - } - - if (codeChallenge.Length < _options.InputLengthRestrictions.CodeChallengeMinLength || - codeChallenge.Length > _options.InputLengthRestrictions.CodeChallengeMaxLength) - { - LogError("code_challenge is either too short or too long", request); - fail.ErrorDescription = "Invalid code_challenge"; - return fail; - } - - request.CodeChallenge = codeChallenge; - - var codeChallengeMethod = request.Raw.Get(OidcConstants.AuthorizeRequest.CodeChallengeMethod); - if (codeChallengeMethod.IsMissing()) - { - _logger.LogDebug("Missing code_challenge_method, defaulting to plain"); - codeChallengeMethod = OidcConstants.CodeChallengeMethods.Plain; - } - - if (!Constants.SupportedCodeChallengeMethods.Contains(codeChallengeMethod)) - { - LogError("Unsupported code_challenge_method", codeChallengeMethod, request); - fail.ErrorDescription = "Transform algorithm not supported"; - return fail; - } - - // check if plain method is allowed - if (codeChallengeMethod == OidcConstants.CodeChallengeMethods.Plain) - { - if (!request.Client.AllowPlainTextPkce) - { - LogError("code_challenge_method of plain is not allowed", request); - fail.ErrorDescription = "Transform algorithm not supported"; - return fail; - } - } - - request.CodeChallengeMethod = codeChallengeMethod; - - return Valid(request); - } - - private async Task ValidateScopeAsync(ValidatedAuthorizeRequest request) - { - ////////////////////////////////////////////////////////// - // scope must be present - ////////////////////////////////////////////////////////// - var scope = request.Raw.Get(OidcConstants.AuthorizeRequest.Scope); - if (scope.IsMissing()) - { - LogError("scope is missing", request); - return Invalid(request, description: "Invalid scope"); - } - - if (scope.Length > _options.InputLengthRestrictions.Scope) - { - LogError("scopes too long.", request); - return Invalid(request, description: "Invalid scope"); - } - - request.RequestedScopes = scope.FromSpaceSeparatedString().Distinct().ToList(); - - if (request.RequestedScopes.Contains(IdentityServerConstants.StandardScopes.OpenId)) - { - request.IsOpenIdRequest = true; - } - - ////////////////////////////////////////////////////////// - // check scope vs response_type plausability - ////////////////////////////////////////////////////////// - var requirement = Constants.ResponseTypeToScopeRequirement[request.ResponseType]; - if (requirement == Constants.ScopeRequirement.Identity || - requirement == Constants.ScopeRequirement.IdentityOnly) - { - if (request.IsOpenIdRequest == false) - { - LogError("response_type requires the openid scope", request); - return Invalid(request, description: "Missing openid scope"); - } - } - - ////////////////////////////////////////////////////////// - // check if scopes are valid/supported and check for resource scopes - ////////////////////////////////////////////////////////// - var validatedResources = await _resourceValidator.ValidateRequestedResourcesAsync(new ResourceValidationRequest - { - Client = request.Client, - Scopes = request.RequestedScopes - }); - - if (!validatedResources.Succeeded) - { - return Invalid(request, OidcConstants.AuthorizeErrors.InvalidScope, "Invalid scope"); - } - - if (validatedResources.Resources.IdentityResources.Any() && !request.IsOpenIdRequest) - { - LogError("Identity related scope requests, but no openid scope", request); - return Invalid(request, OidcConstants.AuthorizeErrors.InvalidScope, "Identity scopes requested, but openid scope is missing"); - } - - if (validatedResources.Resources.ApiScopes.Any()) - { - request.IsApiResourceRequest = true; - } - - ////////////////////////////////////////////////////////// - // check id vs resource scopes and response types plausability - ////////////////////////////////////////////////////////// - var responseTypeValidationCheck = true; - switch (requirement) - { - case Constants.ScopeRequirement.Identity: - if (!validatedResources.Resources.IdentityResources.Any()) - { - _logger.LogError("Requests for id_token response type must include identity scopes"); - responseTypeValidationCheck = false; - } - break; - case Constants.ScopeRequirement.IdentityOnly: - if (!validatedResources.Resources.IdentityResources.Any() || validatedResources.Resources.ApiScopes.Any()) - { - _logger.LogError("Requests for id_token response type only must not include resource scopes"); - responseTypeValidationCheck = false; - } - break; - case Constants.ScopeRequirement.ResourceOnly: - if (validatedResources.Resources.IdentityResources.Any() || !validatedResources.Resources.ApiScopes.Any()) - { - _logger.LogError("Requests for token response type only must include resource scopes, but no identity scopes."); - responseTypeValidationCheck = false; - } - break; - } - - if (!responseTypeValidationCheck) - { - return Invalid(request, OidcConstants.AuthorizeErrors.InvalidScope, "Invalid scope for response type"); - } - - request.ValidatedResources = validatedResources; - - return Valid(request); - } - - private async Task ValidateOptionalParametersAsync(ValidatedAuthorizeRequest request) - { - ////////////////////////////////////////////////////////// - // check nonce - ////////////////////////////////////////////////////////// - var nonce = request.Raw.Get(OidcConstants.AuthorizeRequest.Nonce); - if (nonce.IsPresent()) - { - if (nonce.Length > _options.InputLengthRestrictions.Nonce) - { - LogError("Nonce too long", request); - return Invalid(request, description: "Invalid nonce"); - } - - request.Nonce = nonce; - } - else - { - if (request.GrantType == GrantType.Implicit || - request.GrantType == GrantType.Hybrid) - { - // only openid requests require nonce - if (request.IsOpenIdRequest) - { - LogError("Nonce required for implicit and hybrid flow with openid scope", request); - return Invalid(request, description: "Invalid nonce"); - } - } - } - - - ////////////////////////////////////////////////////////// - // check prompt - ////////////////////////////////////////////////////////// - var prompt = request.Raw.Get(OidcConstants.AuthorizeRequest.Prompt); - if (prompt.IsPresent()) - { - var prompts = prompt.Split(' ', StringSplitOptions.RemoveEmptyEntries); - if (prompts.All(p => Constants.SupportedPromptModes.Contains(p))) - { - if (prompts.Contains(OidcConstants.PromptModes.None) && prompts.Length > 1) - { - LogError("prompt contains 'none' and other values. 'none' should be used by itself.", request); - return Invalid(request, description: "Invalid prompt"); - } - - request.PromptModes = prompts; - } - else - { - _logger.LogDebug("Unsupported prompt mode - ignored: " + prompt); - } - } - - ////////////////////////////////////////////////////////// - // check ui locales - ////////////////////////////////////////////////////////// - var uilocales = request.Raw.Get(OidcConstants.AuthorizeRequest.UiLocales); - if (uilocales.IsPresent()) - { - if (uilocales.Length > _options.InputLengthRestrictions.UiLocale) - { - LogError("UI locale too long", request); - return Invalid(request, description: "Invalid ui_locales"); - } - - request.UiLocales = uilocales; - } - - ////////////////////////////////////////////////////////// - // check display - ////////////////////////////////////////////////////////// - var display = request.Raw.Get(OidcConstants.AuthorizeRequest.Display); - if (display.IsPresent()) - { - if (Constants.SupportedDisplayModes.Contains(display)) - { - request.DisplayMode = display; - } - - _logger.LogDebug("Unsupported display mode - ignored: " + display); - } - - ////////////////////////////////////////////////////////// - // check max_age - ////////////////////////////////////////////////////////// - var maxAge = request.Raw.Get(OidcConstants.AuthorizeRequest.MaxAge); - if (maxAge.IsPresent()) - { - if (int.TryParse(maxAge, out var seconds)) - { - if (seconds >= 0) - { - request.MaxAge = seconds; - } - else - { - LogError("Invalid max_age.", request); - return Invalid(request, description: "Invalid max_age"); - } - } - else - { - LogError("Invalid max_age.", request); - return Invalid(request, description: "Invalid max_age"); - } - } - - ////////////////////////////////////////////////////////// - // check login_hint - ////////////////////////////////////////////////////////// - var loginHint = request.Raw.Get(OidcConstants.AuthorizeRequest.LoginHint); - if (loginHint.IsPresent()) - { - if (loginHint.Length > _options.InputLengthRestrictions.LoginHint) - { - LogError("Login hint too long", request); - return Invalid(request, description: "Invalid login_hint"); - } - - request.LoginHint = loginHint; - } - - ////////////////////////////////////////////////////////// - // check acr_values - ////////////////////////////////////////////////////////// - var acrValues = request.Raw.Get(OidcConstants.AuthorizeRequest.AcrValues); - if (acrValues.IsPresent()) - { - if (acrValues.Length > _options.InputLengthRestrictions.AcrValues) - { - LogError("Acr values too long", request); - return Invalid(request, description: "Invalid acr_values"); - } - - request.AuthenticationContextReferenceClasses = acrValues.FromSpaceSeparatedString().Distinct().ToList(); - } - - ////////////////////////////////////////////////////////// - // check custom acr_values: idp - ////////////////////////////////////////////////////////// - var idp = request.GetIdP(); - if (idp.IsPresent()) - { - // if idp is present but client does not allow it, strip it from the request message - if (request.Client.IdentityProviderRestrictions != null && request.Client.IdentityProviderRestrictions.Any()) - { - if (!request.Client.IdentityProviderRestrictions.Contains(idp)) - { - _logger.LogWarning("idp requested ({idp}) is not in client restriction list.", idp); - request.RemoveIdP(); - } - } - } - - ////////////////////////////////////////////////////////// - // check session cookie - ////////////////////////////////////////////////////////// - if (_options.Endpoints.EnableCheckSessionEndpoint) - { - if (request.Subject.IsAuthenticated()) - { - var sessionId = await _userSession.GetSessionIdAsync(); - if (sessionId.IsPresent()) - { - request.SessionId = sessionId; - } - else - { - LogError("Check session endpoint enabled, but SessionId is missing", request); - } - } - else - { - request.SessionId = ""; // empty string for anonymous users - } - } - - return Valid(request); - } - - private AuthorizeRequestValidationResult Invalid(ValidatedAuthorizeRequest request, string error = OidcConstants.AuthorizeErrors.InvalidRequest, string description = null) - { - return new AuthorizeRequestValidationResult(request, error, description); - } - - private AuthorizeRequestValidationResult Valid(ValidatedAuthorizeRequest request) - { - return new AuthorizeRequestValidationResult(request); - } - - private void LogError(string message, ValidatedAuthorizeRequest request) - { - var requestDetails = new AuthorizeRequestValidationLog(request, _options.Logging.AuthorizeRequestSensitiveValuesFilter); - _logger.LogError(message + "\n{@requestDetails}", requestDetails); - } - - private void LogError(string message, string detail, ValidatedAuthorizeRequest request) - { - var requestDetails = new AuthorizeRequestValidationLog(request, _options.Logging.AuthorizeRequestSensitiveValuesFilter); - _logger.LogError(message + ": {detail}\n{@requestDetails}", detail, requestDetails); - } - } -} +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using IdentityModel; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; +using ForgePoint.Identity.Logging.Models; + +namespace ForgePoint.Identity.Validation +{ + internal class AuthorizeRequestValidator : IAuthorizeRequestValidator + { + private readonly IdentityServerOptions _options; + private readonly IClientStore _clients; + private readonly ICustomAuthorizeRequestValidator _customValidator; + private readonly IRedirectUriValidator _uriValidator; + private readonly IResourceValidator _resourceValidator; + private readonly IUserSession _userSession; + private readonly JwtRequestValidator _jwtRequestValidator; + private readonly IJwtRequestUriHttpClient _jwtRequestUriHttpClient; + private readonly IPushedAuthorizationStore _pushedAuthorizationStore; + private readonly ILogger _logger; + + private readonly ResponseTypeEqualityComparer + _responseTypeEqualityComparer = new ResponseTypeEqualityComparer(); + + public AuthorizeRequestValidator( + IdentityServerOptions options, + IClientStore clients, + ICustomAuthorizeRequestValidator customValidator, + IRedirectUriValidator uriValidator, + IResourceValidator resourceValidator, + IUserSession userSession, + JwtRequestValidator jwtRequestValidator, + IJwtRequestUriHttpClient jwtRequestUriHttpClient, + IPushedAuthorizationStore pushedAuthorizationStore, + ILogger logger) + { + _options = options; + _clients = clients; + _customValidator = customValidator; + _uriValidator = uriValidator; + _resourceValidator = resourceValidator; + _jwtRequestValidator = jwtRequestValidator; + _userSession = userSession; + _jwtRequestUriHttpClient = jwtRequestUriHttpClient; + _pushedAuthorizationStore = pushedAuthorizationStore; + _logger = logger; + } + + public async Task ValidateAsync(NameValueCollection parameters, ClaimsPrincipal subject = null) + { + _logger.LogDebug("Start authorize request protocol validation"); + + var request = new ValidatedAuthorizeRequest + { + Options = _options, + Subject = subject ?? Principal.Anonymous, + Raw = parameters ?? throw new ArgumentNullException(nameof(parameters)) + }; + + // load client_id + // client_id must always be present on the request + var loadClientResult = await LoadClientAsync(request); + if (loadClientResult.IsError) + { + return loadClientResult; + } + + var parResult = await LoadPushedAuthorizationRequestAsync(request); + if (parResult.IsError) + { + return parResult; + } + + // load request object + var roLoadResult = await LoadRequestObjectAsync(request); + if (roLoadResult.IsError) + { + return roLoadResult; + } + + // validate request object + var roValidationResult = await ValidateRequestObjectAsync(request); + if (roValidationResult.IsError) + { + return roValidationResult; + } + + // validate client_id and redirect_uri + var clientResult = await ValidateClientAsync(request); + if (clientResult.IsError) + { + return clientResult; + } + + // state, response_type, response_mode + var mandatoryResult = ValidateCoreParameters(request); + if (mandatoryResult.IsError) + { + return mandatoryResult; + } + + // scope, scope restrictions and plausability + var scopeResult = await ValidateScopeAsync(request); + if (scopeResult.IsError) + { + return scopeResult; + } + + // nonce, prompt, acr_values, login_hint etc. + var optionalResult = await ValidateOptionalParametersAsync(request); + if (optionalResult.IsError) + { + return optionalResult; + } + + // custom validator + _logger.LogDebug("Calling into custom validator: {type}", _customValidator.GetType().FullName); + var context = new CustomAuthorizeRequestValidationContext + { + Result = new AuthorizeRequestValidationResult(request) + }; + await _customValidator.ValidateAsync(context); + + var customResult = context.Result; + if (customResult.IsError) + { + LogError("Error in custom validation", customResult.Error, request); + return Invalid(request, customResult.Error, customResult.ErrorDescription); + } + + _logger.LogTrace("Authorize request protocol validation successful"); + + return Valid(request); + } + + private async Task LoadPushedAuthorizationRequestAsync(ValidatedAuthorizeRequest request) + { + var requestUri = request.Raw.Get(OidcConstants.AuthorizeRequest.RequestUri); + var isPar = requestUri.IsPresent() && + requestUri.StartsWith(Constants.PushedAuthorizationRequestUriPrefix, StringComparison.Ordinal); + + if (!isPar) + { + if (_options.PushedAuthorization.Required || request.Client.RequirePushedAuthorization) + { + LogError("Client requires pushed authorization requests", request); + return Invalid(request, description: "Pushed authorization request is required"); + } + + return Valid(request); + } + + if (!_options.Endpoints.EnablePushedAuthorizationEndpoint) + { + LogError("PAR request_uri present but PAR endpoint is disabled", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "Pushed authorization is not enabled"); + } + + var extra = new List(); + foreach (var key in request.Raw.AllKeys) + { + if (key != null && + key != OidcConstants.AuthorizeRequest.ClientId && + key != OidcConstants.AuthorizeRequest.RequestUri) + { + extra.Add(key); + } + } + + if (extra.Count > 0) + { + LogError("Authorize request with PAR request_uri contained extra parameters", request); + return Invalid(request, description: "Only client_id and request_uri are allowed when using PAR"); + } + + var par = await _pushedAuthorizationStore.GetAsync(requestUri); + if (par == null) + { + LogError("PAR request_uri is invalid or expired", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "Invalid request_uri"); + } + + if (par.ClientId != request.Client.ClientId) + { + LogError("PAR request_uri was issued to a different client", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "Invalid request_uri"); + } + + await _pushedAuthorizationStore.RemoveAsync(requestUri); + + var stored = new NameValueCollection(); + foreach (var kv in par.Parameters) + { + stored[kv.Key] = kv.Value; + } + + request.Raw = stored; + _logger.LogDebug("Loaded pushed authorization request for client {clientId}", request.ClientId); + return Valid(request); + } + + private async Task LoadRequestObjectAsync(ValidatedAuthorizeRequest request) + { + var jwtRequest = request.Raw.Get(OidcConstants.AuthorizeRequest.Request); + var jwtRequestUri = request.Raw.Get(OidcConstants.AuthorizeRequest.RequestUri); + + if (jwtRequest.IsPresent() && jwtRequestUri.IsPresent()) + { + LogError("Both request and request_uri are present", request); + return Invalid(request, description: "Only one request parameter is allowed"); + } + + if (_options.Endpoints.EnableJwtRequestUri) + { + if (jwtRequestUri.IsPresent()) + { + // 512 is from the spec + if (jwtRequestUri.Length > 512) + { + LogError("request_uri is too long", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "request_uri is too long"); + } + + var jwt = await _jwtRequestUriHttpClient.GetJwtAsync(jwtRequestUri, request.Client); + if (jwt.IsMissing()) + { + LogError("no value returned from request_uri", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestUri, description: "no value returned from request_uri"); + } + + jwtRequest = jwt; + } + } + else if (jwtRequestUri.IsPresent()) + { + LogError("request_uri present but config prohibits", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.RequestUriNotSupported); + } + + // check length restrictions + if (jwtRequest.IsPresent()) + { + if (jwtRequest.Length >= _options.InputLengthRestrictions.Jwt) + { + LogError("request value is too long", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestObject, description: "Invalid request value"); + } + } + + request.RequestObject = jwtRequest; + return Valid(request); + } + + private async Task LoadClientAsync(ValidatedAuthorizeRequest request) + { + ////////////////////////////////////////////////////////// + // client_id must be present + ///////////////////////////////////////////////////////// + var clientId = request.Raw.Get(OidcConstants.AuthorizeRequest.ClientId); + + if (clientId.IsMissingOrTooLong(_options.InputLengthRestrictions.ClientId)) + { + LogError("client_id is missing or too long", request); + return Invalid(request, description: "Invalid client_id"); + } + + request.ClientId = clientId; + + ////////////////////////////////////////////////////////// + // check for valid client + ////////////////////////////////////////////////////////// + var client = await _clients.FindEnabledClientByIdAsync(request.ClientId); + if (client == null) + { + LogError("Unknown client or not enabled", request.ClientId, request); + return Invalid(request, OidcConstants.AuthorizeErrors.UnauthorizedClient, "Unknown client or client not enabled"); + } + + request.SetClient(client); + + return Valid(request); + } + + private async Task ValidateRequestObjectAsync(ValidatedAuthorizeRequest request) + { + ////////////////////////////////////////////////////////// + // validate request object + ///////////////////////////////////////////////////////// + if (request.RequestObject.IsPresent()) + { + // validate the request JWT for this client + var jwtRequestValidationResult = await _jwtRequestValidator.ValidateAsync(request.Client, request.RequestObject); + if (jwtRequestValidationResult.IsError) + { + LogError("request JWT validation failure", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestObject, description: "Invalid JWT request"); + } + + // validate response_type match + var responseType = request.Raw.Get(OidcConstants.AuthorizeRequest.ResponseType); + if (responseType != null) + { + if (jwtRequestValidationResult.Payload.TryGetValue(OidcConstants.AuthorizeRequest.ResponseType, out var payloadResponseType)) + { + if (payloadResponseType != responseType) + { + LogError("response_type in JWT payload does not match response_type in request", request); + return Invalid(request, description: "Invalid JWT request"); + } + } + } + + // validate client_id mismatch + if (jwtRequestValidationResult.Payload.TryGetValue(OidcConstants.AuthorizeRequest.ClientId, out var payloadClientId)) + { + if (!string.Equals(request.Client.ClientId, payloadClientId, StringComparison.Ordinal)) + { + LogError("client_id in JWT payload does not match client_id in request", request); + return Invalid(request, description: "Invalid JWT request"); + } + } + else + { + LogError("client_id is missing in JWT payload", request); + return Invalid(request, error: OidcConstants.AuthorizeErrors.InvalidRequestObject, description: "Invalid JWT request"); + } + + var ignoreKeys = new[] + { + JwtClaimTypes.Issuer, + JwtClaimTypes.Audience + }; + + // merge jwt payload values into original request parameters + foreach (var key in jwtRequestValidationResult.Payload.Keys) + { + if (ignoreKeys.Contains(key)) continue; + + var value = jwtRequestValidationResult.Payload[key]; + + var qsValue = request.Raw.Get(key); + if (qsValue != null) + { + if (!string.Equals(value, qsValue, StringComparison.Ordinal)) + { + LogError("parameter mismatch between request object and query string parameter.", request); + return Invalid(request, description: "Parameter mismatch in JWT request"); + } + } + + request.Raw.Set(key, value); + } + + request.RequestObjectValues = jwtRequestValidationResult.Payload; + } + + return Valid(request); + } + + private async Task ValidateClientAsync(ValidatedAuthorizeRequest request) + { + ////////////////////////////////////////////////////////// + // check request object requirement + ////////////////////////////////////////////////////////// + if (request.Client.RequireRequestObject) + { + if (!request.RequestObjectValues.Any()) + { + return Invalid(request, description: "Client must use request object, but no request or request_uri parameter present"); + } + } + + ////////////////////////////////////////////////////////// + // redirect_uri must be present, and a valid uri + ////////////////////////////////////////////////////////// + var redirectUri = request.Raw.Get(OidcConstants.AuthorizeRequest.RedirectUri); + + if (redirectUri.IsMissingOrTooLong(_options.InputLengthRestrictions.RedirectUri)) + { + LogError("redirect_uri is missing or too long", request); + return Invalid(request, description: "Invalid redirect_uri"); + } + + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out _)) + { + LogError("malformed redirect_uri", redirectUri, request); + return Invalid(request, description: "Invalid redirect_uri"); + } + + ////////////////////////////////////////////////////////// + // check if client protocol type is oidc + ////////////////////////////////////////////////////////// + if (request.Client.ProtocolType != IdentityServerConstants.ProtocolTypes.OpenIdConnect) + { + LogError("Invalid protocol type for OIDC authorize endpoint", request.Client.ProtocolType, request); + return Invalid(request, OidcConstants.AuthorizeErrors.UnauthorizedClient, description: "Invalid protocol"); + } + + ////////////////////////////////////////////////////////// + // check if redirect_uri is valid + ////////////////////////////////////////////////////////// + if (await _uriValidator.IsRedirectUriValidAsync(redirectUri, request.Client) == false) + { + LogError("Invalid redirect_uri", redirectUri, request); + return Invalid(request, OidcConstants.AuthorizeErrors.InvalidRequest, "Invalid redirect_uri"); + } + + request.RedirectUri = redirectUri; + + return Valid(request); + } + + private AuthorizeRequestValidationResult ValidateCoreParameters(ValidatedAuthorizeRequest request) + { + ////////////////////////////////////////////////////////// + // check state + ////////////////////////////////////////////////////////// + var state = request.Raw.Get(OidcConstants.AuthorizeRequest.State); + if (state.IsPresent()) + { + request.State = state; + } + + ////////////////////////////////////////////////////////// + // response_type must be present and supported + ////////////////////////////////////////////////////////// + var responseType = request.Raw.Get(OidcConstants.AuthorizeRequest.ResponseType); + if (responseType.IsMissing()) + { + LogError("Missing response_type", request); + return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, "Missing response_type"); + } + + // The responseType may come in in an unconventional order. + // Use an IEqualityComparer that doesn't care about the order of multiple values. + // Per https://tools.ietf.org/html/rfc6749#section-3.1.1 - + // 'Extension response types MAY contain a space-delimited (%x20) list of + // values, where the order of values does not matter (e.g., response + // type "a b" is the same as "b a").' + // http://openid.net/specs/oauth-v2-multiple-response-types-1_0-03.html#terminology - + // 'If a response type contains one of more space characters (%20), it is compared + // as a space-delimited list of values in which the order of values does not matter.' + if (!Constants.SupportedResponseTypes.Contains(responseType, _responseTypeEqualityComparer)) + { + LogError("Response type not supported", responseType, request); + return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, "Response type not supported"); + } + + // Even though the responseType may have come in in an unconventional order, + // we still need the request's ResponseType property to be set to the + // conventional, supported response type. + request.ResponseType = Constants.SupportedResponseTypes.First( + supportedResponseType => _responseTypeEqualityComparer.Equals(supportedResponseType, responseType)); + + ////////////////////////////////////////////////////////// + // match response_type to grant type + ////////////////////////////////////////////////////////// + request.GrantType = Constants.ResponseTypeToGrantTypeMapping[request.ResponseType]; + + // set default response mode for flow; this is needed for any client error processing below + request.ResponseMode = Constants.AllowedResponseModesForGrantType[request.GrantType].First(); + + ////////////////////////////////////////////////////////// + // check if flow is allowed at authorize endpoint + ////////////////////////////////////////////////////////// + if (!Constants.AllowedGrantTypesForAuthorizeEndpoint.Contains(request.GrantType)) + { + LogError("Invalid grant type", request.GrantType, request); + return Invalid(request, description: "Invalid response_type"); + } + + ////////////////////////////////////////////////////////// + // check if PKCE is required and validate parameters + ////////////////////////////////////////////////////////// + if (request.GrantType == GrantType.AuthorizationCode || request.GrantType == GrantType.Hybrid) + { + _logger.LogDebug("Checking for PKCE parameters"); + + ///////////////////////////////////////////////////////////////////////////// + // validate code_challenge and code_challenge_method + ///////////////////////////////////////////////////////////////////////////// + var proofKeyResult = ValidatePkceParameters(request); + + if (proofKeyResult.IsError) + { + return proofKeyResult; + } + } + + ////////////////////////////////////////////////////////// + // check response_mode parameter and set response_mode + ////////////////////////////////////////////////////////// + + // check if response_mode parameter is present and valid + var responseMode = request.Raw.Get(OidcConstants.AuthorizeRequest.ResponseMode); + if (responseMode.IsPresent()) + { + if (Constants.SupportedResponseModes.Contains(responseMode)) + { + if (Constants.AllowedResponseModesForGrantType[request.GrantType].Contains(responseMode)) + { + request.ResponseMode = responseMode; + } + else + { + LogError("Invalid response_mode for response_type", responseMode, request); + return Invalid(request, OidcConstants.AuthorizeErrors.InvalidRequest, description: "Invalid response_mode for response_type"); + } + } + else + { + LogError("Unsupported response_mode", responseMode, request); + return Invalid(request, OidcConstants.AuthorizeErrors.UnsupportedResponseType, description: "Invalid response_mode"); + } + } + + + ////////////////////////////////////////////////////////// + // check if grant type is allowed for client + ////////////////////////////////////////////////////////// + if (!request.Client.AllowedGrantTypes.Contains(request.GrantType)) + { + LogError("Invalid grant type for client", request.GrantType, request); + return Invalid(request, OidcConstants.AuthorizeErrors.UnauthorizedClient, "Invalid grant type for client"); + } + + ////////////////////////////////////////////////////////// + // check if response type contains an access token, + // and if client is allowed to request access token via browser + ////////////////////////////////////////////////////////// + var responseTypes = responseType.FromSpaceSeparatedString(); + if (responseTypes.Contains(OidcConstants.ResponseTypes.Token)) + { + if (!request.Client.AllowAccessTokensViaBrowser) + { + LogError("Client requested access token - but client is not configured to receive access tokens via browser", request); + return Invalid(request, description: "Client not configured to receive access tokens via browser"); + } + } + + return Valid(request); + } + + private AuthorizeRequestValidationResult ValidatePkceParameters(ValidatedAuthorizeRequest request) + { + var fail = Invalid(request); + + var codeChallenge = request.Raw.Get(OidcConstants.AuthorizeRequest.CodeChallenge); + if (codeChallenge.IsMissing()) + { + if (request.Client.RequirePkce) + { + LogError("code_challenge is missing", request); + fail.ErrorDescription = "code challenge required"; + } + else + { + _logger.LogDebug("No PKCE used."); + return Valid(request); + } + + return fail; + } + + if (codeChallenge.Length < _options.InputLengthRestrictions.CodeChallengeMinLength || + codeChallenge.Length > _options.InputLengthRestrictions.CodeChallengeMaxLength) + { + LogError("code_challenge is either too short or too long", request); + fail.ErrorDescription = "Invalid code_challenge"; + return fail; + } + + request.CodeChallenge = codeChallenge; + + var codeChallengeMethod = request.Raw.Get(OidcConstants.AuthorizeRequest.CodeChallengeMethod); + if (codeChallengeMethod.IsMissing()) + { + _logger.LogDebug("Missing code_challenge_method, defaulting to plain"); + codeChallengeMethod = OidcConstants.CodeChallengeMethods.Plain; + } + + if (!Constants.SupportedCodeChallengeMethods.Contains(codeChallengeMethod)) + { + LogError("Unsupported code_challenge_method", codeChallengeMethod, request); + fail.ErrorDescription = "Transform algorithm not supported"; + return fail; + } + + // check if plain method is allowed + if (codeChallengeMethod == OidcConstants.CodeChallengeMethods.Plain) + { + if (!request.Client.AllowPlainTextPkce) + { + LogError("code_challenge_method of plain is not allowed", request); + fail.ErrorDescription = "Transform algorithm not supported"; + return fail; + } + } + + request.CodeChallengeMethod = codeChallengeMethod; + + return Valid(request); + } + + private async Task ValidateScopeAsync(ValidatedAuthorizeRequest request) + { + ////////////////////////////////////////////////////////// + // scope must be present + ////////////////////////////////////////////////////////// + var scope = request.Raw.Get(OidcConstants.AuthorizeRequest.Scope); + if (scope.IsMissing()) + { + LogError("scope is missing", request); + return Invalid(request, description: "Invalid scope"); + } + + if (scope.Length > _options.InputLengthRestrictions.Scope) + { + LogError("scopes too long.", request); + return Invalid(request, description: "Invalid scope"); + } + + request.RequestedScopes = scope.FromSpaceSeparatedString().Distinct().ToList(); + + if (request.RequestedScopes.Contains(IdentityServerConstants.StandardScopes.OpenId)) + { + request.IsOpenIdRequest = true; + } + + ////////////////////////////////////////////////////////// + // check scope vs response_type plausability + ////////////////////////////////////////////////////////// + var requirement = Constants.ResponseTypeToScopeRequirement[request.ResponseType]; + if (requirement == Constants.ScopeRequirement.Identity || + requirement == Constants.ScopeRequirement.IdentityOnly) + { + if (request.IsOpenIdRequest == false) + { + LogError("response_type requires the openid scope", request); + return Invalid(request, description: "Missing openid scope"); + } + } + + ////////////////////////////////////////////////////////// + // check if scopes are valid/supported and check for resource scopes + ////////////////////////////////////////////////////////// + var validatedResources = await _resourceValidator.ValidateRequestedResourcesAsync(new ResourceValidationRequest + { + Client = request.Client, + Scopes = request.RequestedScopes + }); + + if (!validatedResources.Succeeded) + { + return Invalid(request, OidcConstants.AuthorizeErrors.InvalidScope, "Invalid scope"); + } + + if (validatedResources.Resources.IdentityResources.Any() && !request.IsOpenIdRequest) + { + LogError("Identity related scope requests, but no openid scope", request); + return Invalid(request, OidcConstants.AuthorizeErrors.InvalidScope, "Identity scopes requested, but openid scope is missing"); + } + + if (validatedResources.Resources.ApiScopes.Any()) + { + request.IsApiResourceRequest = true; + } + + ////////////////////////////////////////////////////////// + // check id vs resource scopes and response types plausability + ////////////////////////////////////////////////////////// + var responseTypeValidationCheck = true; + switch (requirement) + { + case Constants.ScopeRequirement.Identity: + if (!validatedResources.Resources.IdentityResources.Any()) + { + _logger.LogError("Requests for id_token response type must include identity scopes"); + responseTypeValidationCheck = false; + } + break; + case Constants.ScopeRequirement.IdentityOnly: + if (!validatedResources.Resources.IdentityResources.Any() || validatedResources.Resources.ApiScopes.Any()) + { + _logger.LogError("Requests for id_token response type only must not include resource scopes"); + responseTypeValidationCheck = false; + } + break; + case Constants.ScopeRequirement.ResourceOnly: + if (validatedResources.Resources.IdentityResources.Any() || !validatedResources.Resources.ApiScopes.Any()) + { + _logger.LogError("Requests for token response type only must include resource scopes, but no identity scopes."); + responseTypeValidationCheck = false; + } + break; + } + + if (!responseTypeValidationCheck) + { + return Invalid(request, OidcConstants.AuthorizeErrors.InvalidScope, "Invalid scope for response type"); + } + + request.ValidatedResources = validatedResources; + + return Valid(request); + } + + private async Task ValidateOptionalParametersAsync(ValidatedAuthorizeRequest request) + { + ////////////////////////////////////////////////////////// + // check nonce + ////////////////////////////////////////////////////////// + var nonce = request.Raw.Get(OidcConstants.AuthorizeRequest.Nonce); + if (nonce.IsPresent()) + { + if (nonce.Length > _options.InputLengthRestrictions.Nonce) + { + LogError("Nonce too long", request); + return Invalid(request, description: "Invalid nonce"); + } + + request.Nonce = nonce; + } + else + { + if (request.GrantType == GrantType.Implicit || + request.GrantType == GrantType.Hybrid) + { + // only openid requests require nonce + if (request.IsOpenIdRequest) + { + LogError("Nonce required for implicit and hybrid flow with openid scope", request); + return Invalid(request, description: "Invalid nonce"); + } + } + } + + + ////////////////////////////////////////////////////////// + // check prompt + ////////////////////////////////////////////////////////// + var prompt = request.Raw.Get(OidcConstants.AuthorizeRequest.Prompt); + if (prompt.IsPresent()) + { + var prompts = prompt.Split(' ', StringSplitOptions.RemoveEmptyEntries); + if (prompts.All(p => Constants.SupportedPromptModes.Contains(p))) + { + if (prompts.Contains(OidcConstants.PromptModes.None) && prompts.Length > 1) + { + LogError("prompt contains 'none' and other values. 'none' should be used by itself.", request); + return Invalid(request, description: "Invalid prompt"); + } + + request.PromptModes = prompts; + } + else + { + _logger.LogDebug("Unsupported prompt mode - ignored: " + prompt); + } + } + + ////////////////////////////////////////////////////////// + // check ui locales + ////////////////////////////////////////////////////////// + var uilocales = request.Raw.Get(OidcConstants.AuthorizeRequest.UiLocales); + if (uilocales.IsPresent()) + { + if (uilocales.Length > _options.InputLengthRestrictions.UiLocale) + { + LogError("UI locale too long", request); + return Invalid(request, description: "Invalid ui_locales"); + } + + request.UiLocales = uilocales; + } + + ////////////////////////////////////////////////////////// + // check display + ////////////////////////////////////////////////////////// + var display = request.Raw.Get(OidcConstants.AuthorizeRequest.Display); + if (display.IsPresent()) + { + if (Constants.SupportedDisplayModes.Contains(display)) + { + request.DisplayMode = display; + } + + _logger.LogDebug("Unsupported display mode - ignored: " + display); + } + + ////////////////////////////////////////////////////////// + // check max_age + ////////////////////////////////////////////////////////// + var maxAge = request.Raw.Get(OidcConstants.AuthorizeRequest.MaxAge); + if (maxAge.IsPresent()) + { + if (int.TryParse(maxAge, out var seconds)) + { + if (seconds >= 0) + { + request.MaxAge = seconds; + } + else + { + LogError("Invalid max_age.", request); + return Invalid(request, description: "Invalid max_age"); + } + } + else + { + LogError("Invalid max_age.", request); + return Invalid(request, description: "Invalid max_age"); + } + } + + ////////////////////////////////////////////////////////// + // check login_hint + ////////////////////////////////////////////////////////// + var loginHint = request.Raw.Get(OidcConstants.AuthorizeRequest.LoginHint); + if (loginHint.IsPresent()) + { + if (loginHint.Length > _options.InputLengthRestrictions.LoginHint) + { + LogError("Login hint too long", request); + return Invalid(request, description: "Invalid login_hint"); + } + + request.LoginHint = loginHint; + } + + ////////////////////////////////////////////////////////// + // check acr_values + ////////////////////////////////////////////////////////// + var acrValues = request.Raw.Get(OidcConstants.AuthorizeRequest.AcrValues); + if (acrValues.IsPresent()) + { + if (acrValues.Length > _options.InputLengthRestrictions.AcrValues) + { + LogError("Acr values too long", request); + return Invalid(request, description: "Invalid acr_values"); + } + + request.AuthenticationContextReferenceClasses = acrValues.FromSpaceSeparatedString().Distinct().ToList(); + } + + ////////////////////////////////////////////////////////// + // check custom acr_values: idp + ////////////////////////////////////////////////////////// + var idp = request.GetIdP(); + if (idp.IsPresent()) + { + // if idp is present but client does not allow it, strip it from the request message + if (request.Client.IdentityProviderRestrictions != null && request.Client.IdentityProviderRestrictions.Any()) + { + if (!request.Client.IdentityProviderRestrictions.Contains(idp)) + { + _logger.LogWarning("idp requested ({idp}) is not in client restriction list.", idp); + request.RemoveIdP(); + } + } + } + + ////////////////////////////////////////////////////////// + // check session cookie + ////////////////////////////////////////////////////////// + if (_options.Endpoints.EnableCheckSessionEndpoint) + { + if (request.Subject.IsAuthenticated()) + { + var sessionId = await _userSession.GetSessionIdAsync(); + if (sessionId.IsPresent()) + { + request.SessionId = sessionId; + } + else + { + LogError("Check session endpoint enabled, but SessionId is missing", request); + } + } + else + { + request.SessionId = ""; // empty string for anonymous users + } + } + + return Valid(request); + } + + private AuthorizeRequestValidationResult Invalid(ValidatedAuthorizeRequest request, string error = OidcConstants.AuthorizeErrors.InvalidRequest, string description = null) + { + return new AuthorizeRequestValidationResult(request, error, description); + } + + private AuthorizeRequestValidationResult Valid(ValidatedAuthorizeRequest request) + { + return new AuthorizeRequestValidationResult(request); + } + + private void LogError(string message, ValidatedAuthorizeRequest request) + { + var requestDetails = new AuthorizeRequestValidationLog(request, _options.Logging.AuthorizeRequestSensitiveValuesFilter); + _logger.LogError(message + "\n{@requestDetails}", requestDetails); + } + + private void LogError(string message, string detail, ValidatedAuthorizeRequest request) + { + var requestDetails = new AuthorizeRequestValidationLog(request, _options.Logging.AuthorizeRequestSensitiveValuesFilter); + _logger.LogError(message + ": {detail}\n{@requestDetails}", detail, requestDetails); + } + } +} diff --git a/src/IdentityServer4/src/Validation/Default/BasicAuthenticationSecretParser.cs b/src/IdentityServer4/src/Validation/Default/BasicAuthenticationSecretParser.cs index 5d2297083..bb06287c6 100644 --- a/src/IdentityServer4/src/Validation/Default/BasicAuthenticationSecretParser.cs +++ b/src/IdentityServer4/src/Validation/Default/BasicAuthenticationSecretParser.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Text; @@ -13,7 +13,7 @@ using IdentityModel; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Parses a Basic Authentication header diff --git a/src/IdentityServer4/src/Validation/Default/BearerTokenUsageValidator.cs b/src/IdentityServer4/src/Validation/Default/BearerTokenUsageValidator.cs index 040194b3f..6773705d3 100644 --- a/src/IdentityServer4/src/Validation/Default/BearerTokenUsageValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/BearerTokenUsageValidator.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates a request that uses a bearer token for authentication diff --git a/src/IdentityServer4/src/Validation/Default/ClientSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/ClientSecretValidator.cs index 360b86ae1..7291afd68 100644 --- a/src/IdentityServer4/src/Validation/Default/ClientSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/ClientSecretValidator.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using System.Threading.Tasks; -using IdentityServer4.Events; +using ForgePoint.Identity.Events; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Http; -using IdentityServer4.Stores; -using IdentityServer4.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates a client secret using the registered secret validators and parsers diff --git a/src/IdentityServer4/src/Validation/Default/DefaultClientConfigurationValidator.cs b/src/IdentityServer4/src/Validation/Default/DefaultClientConfigurationValidator.cs index 19e85844c..b1d69c935 100644 --- a/src/IdentityServer4/src/Validation/Default/DefaultClientConfigurationValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DefaultClientConfigurationValidator.cs @@ -1,15 +1,15 @@ -using IdentityServer4.Configuration; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; using System; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default client configuration validator /// - /// + /// public class DefaultClientConfigurationValidator : IClientConfigurationValidator { private readonly IdentityServerOptions _options; diff --git a/src/IdentityServer4/src/Validation/Default/DefaultCustomAuthorizeRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/DefaultCustomAuthorizeRequestValidator.cs index eea5e51e6..693dad33b 100644 --- a/src/IdentityServer4/src/Validation/Default/DefaultCustomAuthorizeRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DefaultCustomAuthorizeRequestValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default custom request validator diff --git a/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenRequestValidator.cs index f058cc81d..680b35820 100644 --- a/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenRequestValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default custom request validator diff --git a/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenValidator.cs b/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenValidator.cs index 1c93f4309..66558565d 100644 --- a/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DefaultCustomTokenValidator.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Logging; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default custom token validator diff --git a/src/IdentityServer4/src/Validation/Default/DefaultResourceValidator.cs b/src/IdentityServer4/src/Validation/Default/DefaultResourceValidator.cs index ebceeb70f..8ff49e439 100644 --- a/src/IdentityServer4/src/Validation/Default/DefaultResourceValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DefaultResourceValidator.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Logging; using System; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default implementation of IResourceValidator. diff --git a/src/IdentityServer4/src/Validation/Default/DefaultScopeParser.cs b/src/IdentityServer4/src/Validation/Default/DefaultScopeParser.cs index 6d8cef31b..fd159a066 100644 --- a/src/IdentityServer4/src/Validation/Default/DefaultScopeParser.cs +++ b/src/IdentityServer4/src/Validation/Default/DefaultScopeParser.cs @@ -6,7 +6,7 @@ using System; using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default implementation of IScopeParser. diff --git a/src/IdentityServer4/src/Validation/Default/DeviceAuthorizationRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/DeviceAuthorizationRequestValidator.cs index 089a15666..283ccb87d 100644 --- a/src/IdentityServer4/src/Validation/Default/DeviceAuthorizationRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DeviceAuthorizationRequestValidator.cs @@ -8,13 +8,13 @@ using System.Linq; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Logging; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Logging; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { internal class DeviceAuthorizationRequestValidator : IDeviceAuthorizationRequestValidator { diff --git a/src/IdentityServer4/src/Validation/Default/DeviceCodeValidator.cs b/src/IdentityServer4/src/Validation/Default/DeviceCodeValidator.cs index c95e70d12..f605a104e 100644 --- a/src/IdentityServer4/src/Validation/Default/DeviceCodeValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/DeviceCodeValidator.cs @@ -5,13 +5,14 @@ using System.Linq; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; +using ForgePoint.Identity; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates an incoming token request using the device flow @@ -21,7 +22,7 @@ internal class DeviceCodeValidator : IDeviceCodeValidator private readonly IDeviceFlowCodeService _devices; private readonly IProfileService _profile; private readonly IDeviceFlowThrottlingService _throttlingService; - private readonly ISystemClock _systemClock; + private readonly IClock _systemClock; private readonly ILogger _logger; /// @@ -36,7 +37,7 @@ public DeviceCodeValidator( IDeviceFlowCodeService devices, IProfileService profile, IDeviceFlowThrottlingService throttlingService, - ISystemClock systemClock, + IClock systemClock, ILogger logger) { _devices = devices; diff --git a/src/IdentityServer4/src/Validation/Default/EndSessionRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/EndSessionRequestValidator.cs index a6f2b0db0..f2f6285e4 100644 --- a/src/IdentityServer4/src/Validation/Default/EndSessionRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/EndSessionRequestValidator.cs @@ -3,21 +3,21 @@ using IdentityModel; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.Extensions.Logging; using System.Collections.Specialized; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Http; using System; -using IdentityServer4.Logging.Models; -using IdentityServer4.Models; +using ForgePoint.Identity.Logging.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates requests to the end session endpoint. diff --git a/src/IdentityServer4/src/Validation/Default/ExtensionGrantValidator.cs b/src/IdentityServer4/src/Validation/Default/ExtensionGrantValidator.cs index f67bf0511..bde92b22b 100644 --- a/src/IdentityServer4/src/Validation/Default/ExtensionGrantValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/ExtensionGrantValidator.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates an extension grant request using the registered validators diff --git a/src/IdentityServer4/src/Validation/Default/HashedSharedSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/HashedSharedSecretValidator.cs index 0b2ba62cc..487bde28c 100644 --- a/src/IdentityServer4/src/Validation/Default/HashedSharedSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/HashedSharedSecretValidator.cs @@ -3,15 +3,15 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates a shared secret stored in SHA256 or SHA512 diff --git a/src/IdentityServer4/src/Validation/Default/IntrospectionRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/IntrospectionRequestValidator.cs index e133abad5..7539bc1da 100644 --- a/src/IdentityServer4/src/Validation/Default/IntrospectionRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/IntrospectionRequestValidator.cs @@ -2,17 +2,17 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System.Collections.Specialized; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// The introspection request validator /// - /// + /// internal class IntrospectionRequestValidator : IIntrospectionRequestValidator { private readonly ILogger _logger; diff --git a/src/IdentityServer4/src/Validation/Default/JwtBearerClientAssertionSecretParser.cs b/src/IdentityServer4/src/Validation/Default/JwtBearerClientAssertionSecretParser.cs index e65383c01..be00a654b 100644 --- a/src/IdentityServer4/src/Validation/Default/JwtBearerClientAssertionSecretParser.cs +++ b/src/IdentityServer4/src/Validation/Default/JwtBearerClientAssertionSecretParser.cs @@ -7,13 +7,13 @@ using System.Linq; using System.IdentityModel.Tokens.Jwt; using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Parses a POST body for a JWT bearer client assertion diff --git a/src/IdentityServer4/src/Validation/Default/JwtRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/JwtRequestValidator.cs index 220111617..1e344b50d 100644 --- a/src/IdentityServer4/src/Validation/Default/JwtRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/JwtRequestValidator.cs @@ -4,20 +4,21 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IdentityModel.Tokens.Jwt; using System.Linq; +using System.Text.Json; using System.Threading.Tasks; using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Tokens; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates JWT authorization request objects @@ -175,7 +176,7 @@ protected virtual Task ValidateJwtAsync(string jwtTokenString, RequireExpirationTime = true }; - if (Options.StrictJarValidation) + if (Options?.StrictJarValidation == true) { tokenValidationParameters.ValidTypes = new[] { JwtClaimTypes.JwtTypes.AuthorizationRequest }; } @@ -198,24 +199,38 @@ protected virtual Task> ProcessPayloadAsync(JwtSecuri { if (!Constants.Filters.JwtRequestClaimTypesFilter.Contains(key)) { - var value = token.Payload[key]; - - switch (value) + var converted = ConvertPayloadValue(token.Payload[key]); + if (converted != null) { - case string s: - payload.Add(key, s); - break; - case JObject jobj: - payload.Add(key, jobj.ToString(Formatting.None)); - break; - case JArray jarr: - payload.Add(key, jarr.ToString(Formatting.None)); - break; + payload.Add(key, converted); } } } return Task.FromResult(payload); } + + private static string ConvertPayloadValue(object value) + { + switch (value) + { + case null: + return null; + case string s: + return s; + case JValue jv: + return jv.Type == JTokenType.String ? jv.ToString() : jv.ToString(Newtonsoft.Json.Formatting.None); + case JToken jt: + return jt.ToString(Newtonsoft.Json.Formatting.None); + case JsonElement je: + return je.ValueKind == JsonValueKind.String ? je.GetString() : je.GetRawText(); + case bool b: + return b ? "true" : "false"; + case byte or sbyte or short or ushort or int or uint or long or ulong or float or double or decimal: + return Convert.ToString(value, CultureInfo.InvariantCulture); + default: + return JsonSerializer.Serialize(value); + } + } } } \ No newline at end of file diff --git a/src/IdentityServer4/src/Validation/Default/MutualTlsSecretParser.cs b/src/IdentityServer4/src/Validation/Default/MutualTlsSecretParser.cs index 936f79711..d66117808 100644 --- a/src/IdentityServer4/src/Validation/Default/MutualTlsSecretParser.cs +++ b/src/IdentityServer4/src/Validation/Default/MutualTlsSecretParser.cs @@ -4,13 +4,13 @@ using System; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Parses secret according to MTLS spec diff --git a/src/IdentityServer4/src/Validation/Default/NopClientConfigurationValidator.cs b/src/IdentityServer4/src/Validation/Default/NopClientConfigurationValidator.cs index c3a960592..f00afbef2 100644 --- a/src/IdentityServer4/src/Validation/Default/NopClientConfigurationValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/NopClientConfigurationValidator.cs @@ -1,11 +1,11 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// No-op client configuration validator (for backwards-compatibility). /// - /// + /// public class NopClientConfigurationValidator : IClientConfigurationValidator { /// diff --git a/src/IdentityServer4/src/Validation/Default/NotSupportedResouceOwnerCredentialValidator.cs b/src/IdentityServer4/src/Validation/Default/NotSupportedResouceOwnerCredentialValidator.cs index 26514aeed..bd2617843 100644 --- a/src/IdentityServer4/src/Validation/Default/NotSupportedResouceOwnerCredentialValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/NotSupportedResouceOwnerCredentialValidator.cs @@ -4,14 +4,14 @@ using Microsoft.Extensions.Logging; using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default resource owner password validator (no implementation == not supported) /// - /// + /// public class NotSupportedResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator { private readonly ILogger _logger; diff --git a/src/IdentityServer4/src/Validation/Default/PlainTextSharedSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/PlainTextSharedSecretValidator.cs index bac03ee7b..f0c8ed900 100644 --- a/src/IdentityServer4/src/Validation/Default/PlainTextSharedSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/PlainTextSharedSecretValidator.cs @@ -3,15 +3,15 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates a secret stored in plain text diff --git a/src/IdentityServer4/src/Validation/Default/PostBodySecretParser.cs b/src/IdentityServer4/src/Validation/Default/PostBodySecretParser.cs index 799e93c7a..bbf1b6422 100644 --- a/src/IdentityServer4/src/Validation/Default/PostBodySecretParser.cs +++ b/src/IdentityServer4/src/Validation/Default/PostBodySecretParser.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System.Threading.Tasks; using System.Linq; using IdentityModel; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Parses a POST body for secrets diff --git a/src/IdentityServer4/src/Validation/Default/PrivateKeyJwtSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/PrivateKeyJwtSecretValidator.cs index 3fe0f9417..1d321a0b2 100644 --- a/src/IdentityServer4/src/Validation/Default/PrivateKeyJwtSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/PrivateKeyJwtSecretValidator.cs @@ -7,14 +7,14 @@ using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Tokens; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates a secret based on RS256 signed JWT token @@ -107,7 +107,10 @@ public async Task ValidateAsync(IEnumerable secr }; try { - var handler = new JwtSecurityTokenHandler(); + var handler = new JwtSecurityTokenHandler + { + MapInboundClaims = false + }; handler.ValidateToken(jwtTokenString, tokenValidationParameters, out var token); var jwtToken = (JwtSecurityToken)token; @@ -116,9 +119,8 @@ public async Task ValidateAsync(IEnumerable secr _logger.LogError("Both 'sub' and 'iss' in the client assertion token must have a value of client_id."); return fail; } - - var exp = jwtToken.Payload.Exp; - if (!exp.HasValue) + + if (jwtToken.ValidTo == DateTime.MinValue) { _logger.LogError("exp is missing."); return fail; @@ -138,7 +140,13 @@ public async Task ValidateAsync(IEnumerable secr } else { - await _replayCache.AddAsync(Purpose, jti, DateTimeOffset.FromUnixTimeSeconds(exp.Value).AddMinutes(5)); + var expires = jwtToken.ValidTo; + if (expires.Kind == DateTimeKind.Unspecified) + { + expires = DateTime.SpecifyKind(expires, DateTimeKind.Utc); + } + + await _replayCache.AddAsync(Purpose, jti, new DateTimeOffset(expires).AddMinutes(5)); } return success; diff --git a/src/IdentityServer4/src/Validation/Default/ResponseTypeEqualityComparer.cs b/src/IdentityServer4/src/Validation/Default/ResponseTypeEqualityComparer.cs index 1980c3ab7..526a22fc8 100644 --- a/src/IdentityServer4/src/Validation/Default/ResponseTypeEqualityComparer.cs +++ b/src/IdentityServer4/src/Validation/Default/ResponseTypeEqualityComparer.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Compares resource_type strings, where the order of space-delimited values is insignificant. diff --git a/src/IdentityServer4/src/Validation/Default/SecretParser.cs b/src/IdentityServer4/src/Validation/Default/SecretParser.cs index 9329a6fb6..07dc8e4ff 100644 --- a/src/IdentityServer4/src/Validation/Default/SecretParser.cs +++ b/src/IdentityServer4/src/Validation/Default/SecretParser.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System; @@ -10,7 +10,7 @@ using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Uses the registered secret parsers to parse a secret on the current request diff --git a/src/IdentityServer4/src/Validation/Default/SecretValidator.cs b/src/IdentityServer4/src/Validation/Default/SecretValidator.cs index 31127f2ef..d90e1a6f7 100644 --- a/src/IdentityServer4/src/Validation/Default/SecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/SecretValidator.cs @@ -2,15 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates secrets using the registered validators @@ -19,7 +20,7 @@ public class SecretValidator : ISecretsListValidator { private readonly ILogger _logger; private readonly IEnumerable _validators; - private readonly ISystemClock _clock; + private readonly IClock _clock; /// /// Initializes a new instance of the class. @@ -27,7 +28,7 @@ public class SecretValidator : ISecretsListValidator /// The clock. /// The validators. /// The logger. - public SecretValidator(ISystemClock clock, IEnumerable validators, ILogger logger) + public SecretValidator(IClock clock, IEnumerable validators, ILogger logger) { _clock = clock; _validators = validators; diff --git a/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidator.cs b/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidator.cs index 6abc883d6..8d8adc7f7 100644 --- a/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidator.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default implementation of redirect URI validator. Validates the URIs against diff --git a/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidatorAppAuth.cs b/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidatorAppAuth.cs index df782f27a..10cb79650 100644 --- a/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidatorAppAuth.cs +++ b/src/IdentityServer4/src/Validation/Default/StrictRedirectUriValidatorAppAuth.cs @@ -2,17 +2,17 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Implementation of strict redirect URI validator that allows a random port if 127.0.0.1 is used. /// - /// + /// public class StrictRedirectUriValidatorAppAuth : StrictRedirectUriValidator { private readonly ILogger _logger; diff --git a/src/IdentityServer4/src/Validation/Default/TokenRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/TokenRequestValidator.cs index ecdb1de98..9180eb006 100644 --- a/src/IdentityServer4/src/Validation/Default/TokenRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/TokenRequestValidator.cs @@ -3,12 +3,12 @@ using IdentityModel; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -16,10 +16,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using IdentityServer4.Logging.Models; +using ForgePoint.Identity.Logging.Models; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { internal class TokenRequestValidator : ITokenRequestValidator { @@ -35,7 +36,7 @@ internal class TokenRequestValidator : ITokenRequestValidator private readonly IResourceOwnerPasswordValidator _resourceOwnerValidator; private readonly IProfileService _profile; private readonly IDeviceCodeValidator _deviceCodeValidator; - private readonly ISystemClock _clock; + private readonly IClock _clock; private readonly ILogger _logger; private ValidatedTokenRequest _validatedRequest; @@ -69,7 +70,7 @@ public TokenRequestValidator(IdentityServerOptions options, ITokenValidator tokenValidator, IRefreshTokenService refreshTokenService, IEventService events, - ISystemClock clock, + IClock clock, ILogger logger) { _logger = logger; diff --git a/src/IdentityServer4/src/Validation/Default/TokenRevocationRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/TokenRevocationRequestValidator.cs index 1d3ed007c..22d6ec41f 100644 --- a/src/IdentityServer4/src/Validation/Default/TokenRevocationRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/TokenRevocationRequestValidator.cs @@ -3,19 +3,19 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Specialized; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// The token revocation request validator /// - /// + /// internal class TokenRevocationRequestValidator : ITokenRevocationRequestValidator { private readonly ILogger _logger; diff --git a/src/IdentityServer4/src/Validation/Default/TokenValidator.cs b/src/IdentityServer4/src/Validation/Default/TokenValidator.cs index 342693557..f74647e73 100644 --- a/src/IdentityServer4/src/Validation/Default/TokenValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/TokenValidator.cs @@ -3,9 +3,9 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -14,13 +14,14 @@ using System.Threading.Tasks; using System.IdentityModel.Tokens.Jwt; using Microsoft.IdentityModel.Tokens; -using IdentityServer4.Stores; -using IdentityServer4.Configuration; -using IdentityServer4.Logging.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Logging.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { internal class TokenValidator : ITokenValidator { @@ -32,7 +33,7 @@ internal class TokenValidator : ITokenValidator private readonly IClientStore _clients; private readonly IProfileService _profile; private readonly IKeyMaterialService _keys; - private readonly ISystemClock _clock; + private readonly IClock _clock; private readonly TokenValidationLog _log; public TokenValidator( @@ -44,7 +45,7 @@ public TokenValidator( IRefreshTokenStore refreshTokenStore, ICustomTokenValidator customValidator, IKeyMaterialService keys, - ISystemClock clock, + IClock clock, ILogger logger) { _options = options; diff --git a/src/IdentityServer4/src/Validation/Default/UserInfoRequestValidator.cs b/src/IdentityServer4/src/Validation/Default/UserInfoRequestValidator.cs index f613413b5..b1c6fe623 100644 --- a/src/IdentityServer4/src/Validation/Default/UserInfoRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/UserInfoRequestValidator.cs @@ -3,19 +3,19 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Default userinfo request validator /// - /// + /// internal class UserInfoRequestValidator : IUserInfoRequestValidator { private readonly ITokenValidator _tokenValidator; diff --git a/src/IdentityServer4/src/Validation/Default/X509NameSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/X509NameSecretValidator.cs index 9fc77db86..6b3f71699 100644 --- a/src/IdentityServer4/src/Validation/Default/X509NameSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/X509NameSecretValidator.cs @@ -3,12 +3,12 @@ using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for an X.509 certificate based client secret using the common name diff --git a/src/IdentityServer4/src/Validation/Default/X509ThumbprintSecretValidator.cs b/src/IdentityServer4/src/Validation/Default/X509ThumbprintSecretValidator.cs index 7370df37a..38aed8272 100644 --- a/src/IdentityServer4/src/Validation/Default/X509ThumbprintSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/Default/X509ThumbprintSecretValidator.cs @@ -3,12 +3,12 @@ using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.Extensions.Logging; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for an X.509 certificate based client secret using the thumbprint diff --git a/src/IdentityServer4/src/Validation/IApiSecretValidator.cs b/src/IdentityServer4/src/Validation/IApiSecretValidator.cs index 397603705..68474d425 100644 --- a/src/IdentityServer4/src/Validation/IApiSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/IApiSecretValidator.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for handling API client authentication. diff --git a/src/IdentityServer4/src/Validation/IAuthorizeRequestValidator.cs b/src/IdentityServer4/src/Validation/IAuthorizeRequestValidator.cs index 0545643d8..3d0dfb067 100644 --- a/src/IdentityServer4/src/Validation/IAuthorizeRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/IAuthorizeRequestValidator.cs @@ -6,7 +6,7 @@ using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Authorize endpoint request validator. diff --git a/src/IdentityServer4/src/Validation/IClientConfigurationValidator.cs b/src/IdentityServer4/src/Validation/IClientConfigurationValidator.cs index 787b01aff..a168af18e 100644 --- a/src/IdentityServer4/src/Validation/IClientConfigurationValidator.cs +++ b/src/IdentityServer4/src/Validation/IClientConfigurationValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for handling client authentication diff --git a/src/IdentityServer4/src/Validation/IClientSecretValidator.cs b/src/IdentityServer4/src/Validation/IClientSecretValidator.cs index d71df3f01..e133d6cff 100644 --- a/src/IdentityServer4/src/Validation/IClientSecretValidator.cs +++ b/src/IdentityServer4/src/Validation/IClientSecretValidator.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for handling client authentication diff --git a/src/IdentityServer4/src/Validation/ICustomAuthorizeRequestValidator.cs b/src/IdentityServer4/src/Validation/ICustomAuthorizeRequestValidator.cs index 8865ac51f..fd93dcf25 100644 --- a/src/IdentityServer4/src/Validation/ICustomAuthorizeRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/ICustomAuthorizeRequestValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Allows inserting custom validation logic into authorize and token requests diff --git a/src/IdentityServer4/src/Validation/ICustomTokenRequestValidator.cs b/src/IdentityServer4/src/Validation/ICustomTokenRequestValidator.cs index ff297802f..83655fac8 100644 --- a/src/IdentityServer4/src/Validation/ICustomTokenRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/ICustomTokenRequestValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Allows inserting custom validation logic into token requests diff --git a/src/IdentityServer4/src/Validation/ICustomTokenValidator.cs b/src/IdentityServer4/src/Validation/ICustomTokenValidator.cs index 3952347f3..bd693bf2f 100644 --- a/src/IdentityServer4/src/Validation/ICustomTokenValidator.cs +++ b/src/IdentityServer4/src/Validation/ICustomTokenValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Allows inserting custom token validation logic diff --git a/src/IdentityServer4/src/Validation/IDeviceAuthorizationRequestValidator.cs b/src/IdentityServer4/src/Validation/IDeviceAuthorizationRequestValidator.cs index c83c08718..873c1572d 100644 --- a/src/IdentityServer4/src/Validation/IDeviceAuthorizationRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/IDeviceAuthorizationRequestValidator.cs @@ -5,7 +5,7 @@ using System.Collections.Specialized; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Device authorization endpoint request validator. diff --git a/src/IdentityServer4/src/Validation/IDeviceCodeValidator.cs b/src/IdentityServer4/src/Validation/IDeviceCodeValidator.cs index 91a2bbff4..28d64cd7c 100644 --- a/src/IdentityServer4/src/Validation/IDeviceCodeValidator.cs +++ b/src/IdentityServer4/src/Validation/IDeviceCodeValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// The device code validator diff --git a/src/IdentityServer4/src/Validation/IEndSessionRequestValidator.cs b/src/IdentityServer4/src/Validation/IEndSessionRequestValidator.cs index 4e99ed252..c03d32c3c 100644 --- a/src/IdentityServer4/src/Validation/IEndSessionRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/IEndSessionRequestValidator.cs @@ -6,7 +6,7 @@ using System.Security.Claims; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates end session requests. diff --git a/src/IdentityServer4/src/Validation/IExtensionGrantValidator.cs b/src/IdentityServer4/src/Validation/IExtensionGrantValidator.cs index 0b00ca336..847c9ddb6 100644 --- a/src/IdentityServer4/src/Validation/IExtensionGrantValidator.cs +++ b/src/IdentityServer4/src/Validation/IExtensionGrantValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Handles validation of token requests using custom grant types diff --git a/src/IdentityServer4/src/Validation/IIntrospectionRequestValidator.cs b/src/IdentityServer4/src/Validation/IIntrospectionRequestValidator.cs index 8b7d2e99e..92ff0a0f1 100644 --- a/src/IdentityServer4/src/Validation/IIntrospectionRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/IIntrospectionRequestValidator.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Specialized; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Interface for the introspection request validator diff --git a/src/IdentityServer4/src/Validation/IRedirectUriValidator.cs b/src/IdentityServer4/src/Validation/IRedirectUriValidator.cs index 0d4188685..f83a2cfdd 100644 --- a/src/IdentityServer4/src/Validation/IRedirectUriValidator.cs +++ b/src/IdentityServer4/src/Validation/IRedirectUriValidator.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models the logic when validating redirect and post logout redirect URIs. diff --git a/src/IdentityServer4/src/Validation/IResourceOwnerPasswordValidator.cs b/src/IdentityServer4/src/Validation/IResourceOwnerPasswordValidator.cs index f3065b2ac..09de45b39 100644 --- a/src/IdentityServer4/src/Validation/IResourceOwnerPasswordValidator.cs +++ b/src/IdentityServer4/src/Validation/IResourceOwnerPasswordValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Handles validation of resource owner password credentials diff --git a/src/IdentityServer4/src/Validation/IResourceValidator.cs b/src/IdentityServer4/src/Validation/IResourceValidator.cs index 9f3442e85..82f571299 100644 --- a/src/IdentityServer4/src/Validation/IResourceValidator.cs +++ b/src/IdentityServer4/src/Validation/IResourceValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validates requested resources (scopes and resource indicators) diff --git a/src/IdentityServer4/src/Validation/IScopeParser.cs b/src/IdentityServer4/src/Validation/IScopeParser.cs index 4061fe9b3..140af4fc6 100644 --- a/src/IdentityServer4/src/Validation/IScopeParser.cs +++ b/src/IdentityServer4/src/Validation/IScopeParser.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Allows parsing raw scopes values into structured scope values. diff --git a/src/IdentityServer4/src/Validation/ISecretParser.cs b/src/IdentityServer4/src/Validation/ISecretParser.cs index 2f7ce0d83..de1bd18a6 100644 --- a/src/IdentityServer4/src/Validation/ISecretParser.cs +++ b/src/IdentityServer4/src/Validation/ISecretParser.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// A service for parsing secrets found on the request diff --git a/src/IdentityServer4/src/Validation/ISecretValidator.cs b/src/IdentityServer4/src/Validation/ISecretValidator.cs index 4021ecd5b..45ee101c6 100644 --- a/src/IdentityServer4/src/Validation/ISecretValidator.cs +++ b/src/IdentityServer4/src/Validation/ISecretValidator.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Service for validating a received secret against a stored secret diff --git a/src/IdentityServer4/src/Validation/ISecretsListParser.cs b/src/IdentityServer4/src/Validation/ISecretsListParser.cs index 70a788279..5f144cd55 100644 --- a/src/IdentityServer4/src/Validation/ISecretsListParser.cs +++ b/src/IdentityServer4/src/Validation/ISecretsListParser.cs @@ -1,10 +1,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Parser for finding the best secret in an Enumerable List diff --git a/src/IdentityServer4/src/Validation/ISecretsListValidator.cs b/src/IdentityServer4/src/Validation/ISecretsListValidator.cs index 3ff5ba126..d62217b4f 100644 --- a/src/IdentityServer4/src/Validation/ISecretsListValidator.cs +++ b/src/IdentityServer4/src/Validation/ISecretsListValidator.cs @@ -1,9 +1,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for an Enumerable List of Secrets diff --git a/src/IdentityServer4/src/Validation/ITokenRequestValidator.cs b/src/IdentityServer4/src/Validation/ITokenRequestValidator.cs index 2a44631d4..b4423be6d 100644 --- a/src/IdentityServer4/src/Validation/ITokenRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/ITokenRequestValidator.cs @@ -5,7 +5,7 @@ using System.Collections.Specialized; using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Interface for the token request validator diff --git a/src/IdentityServer4/src/Validation/ITokenRevocationRequestValidator.cs b/src/IdentityServer4/src/Validation/ITokenRevocationRequestValidator.cs index d17f0005b..67678550c 100644 --- a/src/IdentityServer4/src/Validation/ITokenRevocationRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/ITokenRevocationRequestValidator.cs @@ -4,9 +4,9 @@ using System.Collections.Specialized; using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Interface for the token revocation request validator diff --git a/src/IdentityServer4/src/Validation/ITokenValidator.cs b/src/IdentityServer4/src/Validation/ITokenValidator.cs index 495102dcf..7d0069c9f 100644 --- a/src/IdentityServer4/src/Validation/ITokenValidator.cs +++ b/src/IdentityServer4/src/Validation/ITokenValidator.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Interface for the token validator diff --git a/src/IdentityServer4/src/Validation/IUserInfoRequestValidator.cs b/src/IdentityServer4/src/Validation/IUserInfoRequestValidator.cs index 43472c160..b95923f8c 100644 --- a/src/IdentityServer4/src/Validation/IUserInfoRequestValidator.cs +++ b/src/IdentityServer4/src/Validation/IUserInfoRequestValidator.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validator for userinfo requests diff --git a/src/IdentityServer4/src/Validation/Models/AuthorizeRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/AuthorizeRequestValidationResult.cs index 30dce8c1c..07ab37c17 100644 --- a/src/IdentityServer4/src/Validation/Models/AuthorizeRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/AuthorizeRequestValidationResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for authorize requests diff --git a/src/IdentityServer4/src/Validation/Models/BearerTokenUsageType.cs b/src/IdentityServer4/src/Validation/Models/BearerTokenUsageType.cs index edc1ffdbd..a03614ae1 100644 --- a/src/IdentityServer4/src/Validation/Models/BearerTokenUsageType.cs +++ b/src/IdentityServer4/src/Validation/Models/BearerTokenUsageType.cs @@ -5,7 +5,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { public enum BearerTokenUsageType { diff --git a/src/IdentityServer4/src/Validation/Models/BearerTokenUsageValidationResult.cs b/src/IdentityServer4/src/Validation/Models/BearerTokenUsageValidationResult.cs index 403640317..6554fe598 100644 --- a/src/IdentityServer4/src/Validation/Models/BearerTokenUsageValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/BearerTokenUsageValidationResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models usage of a bearer token diff --git a/src/IdentityServer4/src/Validation/Models/ClientSecretValidationResult.cs b/src/IdentityServer4/src/Validation/Models/ClientSecretValidationResult.cs index 41bb0bfd0..e712f7ad0 100644 --- a/src/IdentityServer4/src/Validation/Models/ClientSecretValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/ClientSecretValidationResult.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for client validation diff --git a/src/IdentityServer4/src/Validation/Models/DeviceAuthorizationRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/DeviceAuthorizationRequestValidationResult.cs index 9ce18a551..49715b1e8 100644 --- a/src/IdentityServer4/src/Validation/Models/DeviceAuthorizationRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/DeviceAuthorizationRequestValidationResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for device authorization requests diff --git a/src/IdentityServer4/src/Validation/Models/DeviceCodeValidationContext.cs b/src/IdentityServer4/src/Validation/Models/DeviceCodeValidationContext.cs index f3f2da1e0..60ad2faf3 100644 --- a/src/IdentityServer4/src/Validation/Models/DeviceCodeValidationContext.cs +++ b/src/IdentityServer4/src/Validation/Models/DeviceCodeValidationContext.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for device code validation request. diff --git a/src/IdentityServer4/src/Validation/Models/EndSessionCallbackValidationResult.cs b/src/IdentityServer4/src/Validation/Models/EndSessionCallbackValidationResult.cs index 904510748..fbeef954e 100644 --- a/src/IdentityServer4/src/Validation/Models/EndSessionCallbackValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/EndSessionCallbackValidationResult.cs @@ -4,12 +4,12 @@ using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for end session callback requests. /// - /// + /// public class EndSessionCallbackValidationResult : ValidationResult { /// diff --git a/src/IdentityServer4/src/Validation/Models/EndSessionValidationResult.cs b/src/IdentityServer4/src/Validation/Models/EndSessionValidationResult.cs index 69fa2283a..612ae3a90 100644 --- a/src/IdentityServer4/src/Validation/Models/EndSessionValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/EndSessionValidationResult.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for end session requests /// - /// + /// public class EndSessionValidationResult : ValidationResult { /// diff --git a/src/IdentityServer4/src/Validation/Models/GrantValidationResult.cs b/src/IdentityServer4/src/Validation/Models/GrantValidationResult.cs index f4f6a1cb4..afd1a9ac9 100644 --- a/src/IdentityServer4/src/Validation/Models/GrantValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/GrantValidationResult.cs @@ -3,14 +3,14 @@ using IdentityModel; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models the result of custom grant validation. diff --git a/src/IdentityServer4/src/Validation/Models/IntrospectionRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/IntrospectionRequestValidationResult.cs index b38599f96..7a8f1df49 100644 --- a/src/IdentityServer4/src/Validation/Models/IntrospectionRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/IntrospectionRequestValidationResult.cs @@ -2,17 +2,17 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Collections.Specialized; using System.Security.Claims; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for introspection request /// - /// + /// public class IntrospectionRequestValidationResult : ValidationResult { /// diff --git a/src/IdentityServer4/src/Validation/Models/JwtRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/JwtRequestValidationResult.cs index 1db8168e7..ffe95dcf7 100644 --- a/src/IdentityServer4/src/Validation/Models/JwtRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/JwtRequestValidationResult.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models the result of JWT request validation. diff --git a/src/IdentityServer4/src/Validation/Models/ParsedScopeValidationError.cs b/src/IdentityServer4/src/Validation/Models/ParsedScopeValidationError.cs index 8f3b4f929..fe72d08d4 100644 --- a/src/IdentityServer4/src/Validation/Models/ParsedScopeValidationError.cs +++ b/src/IdentityServer4/src/Validation/Models/ParsedScopeValidationError.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models an error parsing a scope. diff --git a/src/IdentityServer4/src/Validation/Models/ParsedScopeValue.cs b/src/IdentityServer4/src/Validation/Models/ParsedScopeValue.cs index 4e0e48095..568e8a59d 100644 --- a/src/IdentityServer4/src/Validation/Models/ParsedScopeValue.cs +++ b/src/IdentityServer4/src/Validation/Models/ParsedScopeValue.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models a parsed scope value. diff --git a/src/IdentityServer4/src/Validation/Models/ParsedScopesResult.cs b/src/IdentityServer4/src/Validation/Models/ParsedScopesResult.cs index 69ddc4d4a..fa3b275cf 100644 --- a/src/IdentityServer4/src/Validation/Models/ParsedScopesResult.cs +++ b/src/IdentityServer4/src/Validation/Models/ParsedScopesResult.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Represents the result of scope parsing. diff --git a/src/IdentityServer4/src/Validation/Models/ResourceValidationRequest.cs b/src/IdentityServer4/src/Validation/Models/ResourceValidationRequest.cs index 6fe3fcd01..fa12a555c 100644 --- a/src/IdentityServer4/src/Validation/Models/ResourceValidationRequest.cs +++ b/src/IdentityServer4/src/Validation/Models/ResourceValidationRequest.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models the request to validate scopes and resource indicators for a client. diff --git a/src/IdentityServer4/src/Validation/Models/ResourceValidationResult.cs b/src/IdentityServer4/src/Validation/Models/ResourceValidationResult.cs index e069bb72e..f2c85b1e7 100644 --- a/src/IdentityServer4/src/Validation/Models/ResourceValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/ResourceValidationResult.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Result of validation of requested scopes and resource indicators. diff --git a/src/IdentityServer4/src/Validation/Models/ScopeSecretValidationResult.cs b/src/IdentityServer4/src/Validation/Models/ScopeSecretValidationResult.cs index a318d9750..d13a68ef2 100644 --- a/src/IdentityServer4/src/Validation/Models/ScopeSecretValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/ScopeSecretValidationResult.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for API validation diff --git a/src/IdentityServer4/src/Validation/Models/SecretValidationResult.cs b/src/IdentityServer4/src/Validation/Models/SecretValidationResult.cs index e4bc930ff..afc5eac87 100644 --- a/src/IdentityServer4/src/Validation/Models/SecretValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/SecretValidationResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for secrets diff --git a/src/IdentityServer4/src/Validation/Models/TokenRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/TokenRequestValidationResult.cs index e59014668..d83b6a3c4 100644 --- a/src/IdentityServer4/src/Validation/Models/TokenRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/TokenRequestValidationResult.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for token requests diff --git a/src/IdentityServer4/src/Validation/Models/TokenRevocationRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/TokenRevocationRequestValidationResult.cs index c13109c3c..78656c5f7 100644 --- a/src/IdentityServer4/src/Validation/Models/TokenRevocationRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/TokenRevocationRequestValidationResult.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models the validation result of access tokens and id tokens. diff --git a/src/IdentityServer4/src/Validation/Models/TokenValidationResult.cs b/src/IdentityServer4/src/Validation/Models/TokenValidationResult.cs index f9e9cdcea..42992c734 100644 --- a/src/IdentityServer4/src/Validation/Models/TokenValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/TokenValidationResult.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Security.Claims; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models the validation result of access tokens and id tokens. diff --git a/src/IdentityServer4/src/Validation/Models/UserInfoRequestValidationResult.cs b/src/IdentityServer4/src/Validation/Models/UserInfoRequestValidationResult.cs index f9bca67dc..30ea29e0a 100644 --- a/src/IdentityServer4/src/Validation/Models/UserInfoRequestValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/UserInfoRequestValidationResult.cs @@ -4,7 +4,7 @@ using System.Security.Claims; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Validation result for userinfo requests diff --git a/src/IdentityServer4/src/Validation/Models/ValidatedAuthorizeRequest.cs b/src/IdentityServer4/src/Validation/Models/ValidatedAuthorizeRequest.cs index 441cb0d99..8a32a7313 100644 --- a/src/IdentityServer4/src/Validation/Models/ValidatedAuthorizeRequest.cs +++ b/src/IdentityServer4/src/Validation/Models/ValidatedAuthorizeRequest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models a validated request to the authorize endpoint. diff --git a/src/IdentityServer4/src/Validation/Models/ValidatedDeviceAuthorizationRequest.cs b/src/IdentityServer4/src/Validation/Models/ValidatedDeviceAuthorizationRequest.cs index 3d11e12f1..0e25e1790 100644 --- a/src/IdentityServer4/src/Validation/Models/ValidatedDeviceAuthorizationRequest.cs +++ b/src/IdentityServer4/src/Validation/Models/ValidatedDeviceAuthorizationRequest.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models a validated request to the device authorization endpoint. diff --git a/src/IdentityServer4/src/Validation/Models/ValidatedEndSessionRequest.cs b/src/IdentityServer4/src/Validation/Models/ValidatedEndSessionRequest.cs index 43ded4951..3c8d35be3 100644 --- a/src/IdentityServer4/src/Validation/Models/ValidatedEndSessionRequest.cs +++ b/src/IdentityServer4/src/Validation/Models/ValidatedEndSessionRequest.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Represents a validated end session (logout) request diff --git a/src/IdentityServer4/src/Validation/Models/ValidatedRequest.cs b/src/IdentityServer4/src/Validation/Models/ValidatedRequest.cs index 235ed9178..7284aea09 100644 --- a/src/IdentityServer4/src/Validation/Models/ValidatedRequest.cs +++ b/src/IdentityServer4/src/Validation/Models/ValidatedRequest.cs @@ -3,15 +3,15 @@ using System.Collections.Generic; -using IdentityServer4.Configuration; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; using System.Collections.Specialized; using System.Security.Claims; using IdentityModel; using System.Linq; using System; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Base class for a validate authorize or token request diff --git a/src/IdentityServer4/src/Validation/Models/ValidatedTokenRequest.cs b/src/IdentityServer4/src/Validation/Models/ValidatedTokenRequest.cs index a4bad6125..122f90ac2 100644 --- a/src/IdentityServer4/src/Validation/Models/ValidatedTokenRequest.cs +++ b/src/IdentityServer4/src/Validation/Models/ValidatedTokenRequest.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Models a validated request to the token endpoint. diff --git a/src/IdentityServer4/src/Validation/Models/ValidationResult.cs b/src/IdentityServer4/src/Validation/Models/ValidationResult.cs index 054358459..747e23c12 100644 --- a/src/IdentityServer4/src/Validation/Models/ValidationResult.cs +++ b/src/IdentityServer4/src/Validation/Models/ValidationResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Validation +namespace ForgePoint.Identity.Validation { /// /// Minimal validation result class (base-class for more complext validation results) diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientAssertionClient.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientAssertionClient.cs index ffad33f12..e76c76e6e 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientAssertionClient.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientAssertionClient.cs @@ -66,6 +66,7 @@ public async Task Valid_client_should_succeed() var response = await _client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest { Address = TokenEndpoint, + ClientCredentialStyle = ClientCredentialStyle.PostBody, ClientId = ClientId, ClientAssertion = @@ -88,6 +89,7 @@ public async Task Valid_client_with_implicit_clientId_should_succeed() var response = await _client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest { Address = TokenEndpoint, + ClientCredentialStyle = ClientCredentialStyle.PostBody, ClientId = "client", ClientAssertion = @@ -110,6 +112,7 @@ public async Task Valid_client_with_token_replay_should_fail() var response = await _client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest { Address = TokenEndpoint, + ClientCredentialStyle = ClientCredentialStyle.PostBody, ClientId = ClientId, ClientAssertion = @@ -127,6 +130,7 @@ public async Task Valid_client_with_token_replay_should_fail() response = await _client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest { Address = TokenEndpoint, + ClientCredentialStyle = ClientCredentialStyle.PostBody, ClientId = ClientId, ClientAssertion = @@ -148,6 +152,7 @@ public async Task Client_with_invalid_secret_should_fail() var response = await _client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest { Address = TokenEndpoint, + ClientCredentialStyle = ClientCredentialStyle.PostBody, ClientId = ClientId, ClientAssertion = @@ -173,6 +178,7 @@ public async Task Invalid_client_should_fail() var response = await _client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest { Address = TokenEndpoint, + ClientCredentialStyle = ClientCredentialStyle.PostBody, ClientId = clientId, ClientAssertion = @@ -210,7 +216,7 @@ private void AssertValidToken(TokenResponse response) payload.Should().Contain("client_id", ClientId); payload.Keys.Should().Contain("iat"); - var scopes = payload["scope"] as JArray; + var scopes = TokenJson.AsList(payload["scope"]); scopes.First().ToString().Should().Be("api1"); payload["aud"].Should().Be("api"); diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientCredentialsClient.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientCredentialsClient.cs index 7f5be3a84..3604f80dd 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientCredentialsClient.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/ClientCredentialsClient.cs @@ -12,6 +12,7 @@ using IdentityModel; using IdentityModel.Client; using IdentityServer.IntegrationTests.Clients.Setup; +using IdentityServer.IntegrationTests.Common; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Newtonsoft.Json; @@ -147,7 +148,8 @@ public async Task Valid_request_with_confirmation_should_return_expected_payload var scopes = payload["scope"] as JArray; scopes.First().ToString().Should().Be("api1"); - var cnf = payload["cnf"] as JObject; + var cnf = TokenJson.Deserialize>(payload["cnf"]); + cnf.Should().NotBeNull(); cnf["x5t#S256"].ToString().Should().Be("foo"); } diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenRequestValidatorClient.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenRequestValidatorClient.cs index 83cd26793..1ec5dde11 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenRequestValidatorClient.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenRequestValidatorClient.cs @@ -8,6 +8,7 @@ using FluentAssertions; using IdentityModel.Client; using IdentityServer.IntegrationTests.Clients.Setup; +using IdentityServer.IntegrationTests.Common; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenResponseClients.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenResponseClients.cs index 717910956..1f46eec76 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenResponseClients.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/CustomTokenResponseClients.cs @@ -12,6 +12,7 @@ using IdentityModel; using IdentityModel.Client; using IdentityServer.IntegrationTests.Clients.Setup; +using IdentityServer.IntegrationTests.Common; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Newtonsoft.Json; @@ -62,10 +63,7 @@ public async Task Resource_owner_success_should_return_custom_response() fields.TryGetValue("token_type", out temp).Should().BeTrue(); fields.TryGetValue("expires_in", out temp).Should().BeTrue(); - var responseObject = fields["dto"] as JObject; - responseObject.Should().NotBeNull(); - - var responseDto = GetDto(responseObject); + var responseDto = TokenJson.Deserialize(fields["dto"]); var dto = CustomResponseDto.Create; responseDto.string_value.Should().Be(dto.string_value); @@ -92,10 +90,10 @@ public async Task Resource_owner_success_should_return_custom_response() payload["aud"].Should().Be("api"); - var scopes = payload["scope"] as JArray; + var scopes = TokenJson.AsList(payload["scope"]); scopes.First().ToString().Should().Be("api1"); - var amr = payload["amr"] as JArray; + var amr = TokenJson.AsList(payload["amr"]); amr.Count().Should().Be(1); amr.First().ToString().Should().Be("password"); } @@ -127,10 +125,7 @@ public async Task Resource_owner_failure_should_return_custom_error_response() fields.TryGetValue("token_type", out temp).Should().BeFalse(); fields.TryGetValue("expires_in", out temp).Should().BeFalse(); - var responseObject = fields["dto"] as JObject; - responseObject.Should().NotBeNull(); - - var responseDto = GetDto(responseObject); + var responseDto = TokenJson.Deserialize(fields["dto"]); var dto = CustomResponseDto.Create; responseDto.string_value.Should().Be(dto.string_value); @@ -181,10 +176,7 @@ public async Task Extension_grant_success_should_return_custom_response() fields.TryGetValue("token_type", out temp).Should().BeTrue(); fields.TryGetValue("expires_in", out temp).Should().BeTrue(); - var responseObject = fields["dto"] as JObject; - responseObject.Should().NotBeNull(); - - var responseDto = GetDto(responseObject); + var responseDto = TokenJson.Deserialize(fields["dto"]); var dto = CustomResponseDto.Create; responseDto.string_value.Should().Be(dto.string_value); @@ -211,10 +203,10 @@ public async Task Extension_grant_success_should_return_custom_response() payload["aud"].Should().Be("api"); - var scopes = payload["scope"] as JArray; + var scopes = TokenJson.AsList(payload["scope"]); scopes.First().ToString().Should().Be("api1"); - var amr = payload["amr"] as JArray; + var amr = TokenJson.AsList(payload["amr"]); amr.Count().Should().Be(1); amr.First().ToString().Should().Be("custom"); @@ -252,10 +244,7 @@ public async Task Extension_grant_failure_should_return_custom_error_response() fields.TryGetValue("token_type", out temp).Should().BeFalse(); fields.TryGetValue("expires_in", out temp).Should().BeFalse(); - var responseObject = fields["dto"] as JObject; - responseObject.Should().NotBeNull(); - - var responseDto = GetDto(responseObject); + var responseDto = TokenJson.Deserialize(fields["dto"]); var dto = CustomResponseDto.Create; responseDto.string_value.Should().Be(dto.string_value); @@ -274,11 +263,6 @@ public async Task Extension_grant_failure_should_return_custom_error_response() response.RefreshToken.Should().BeNull(); } - private CustomResponseDto GetDto(JObject responseObject) - { - return responseObject.ToObject(); - } - private Dictionary GetFields(TokenResponse response) { return response.Json.ToObject>(); diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Clients.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Clients.cs index 5ccb18789..cc0afdfb9 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Clients.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Clients.cs @@ -6,8 +6,8 @@ using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ConfirmationSecretValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ConfirmationSecretValidator.cs index 5c5bb01ce..60df43fae 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ConfirmationSecretValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ConfirmationSecretValidator.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Newtonsoft.Json; namespace IdentityServer.IntegrationTests.Clients.Setup diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomProfileService.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomProfileService.cs index 92e3b1d6f..93e5fcad0 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomProfileService.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomProfileService.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Microsoft.Extensions.Logging; namespace IdentityServer.IntegrationTests.Clients.Setup diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseExtensionGrantValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseExtensionGrantValidator.cs index 17895befa..bd0ad1c33 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseExtensionGrantValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseExtensionGrantValidator.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseResourceOwnerValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseResourceOwnerValidator.cs index befbeb76a..36d7f27a3 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseResourceOwnerValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/CustomResponseResourceOwnerValidator.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/DynamicParameterExtensionGrantValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/DynamicParameterExtensionGrantValidator.cs index 771c1ac0b..180d84f1f 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/DynamicParameterExtensionGrantValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/DynamicParameterExtensionGrantValidator.cs @@ -4,8 +4,8 @@ using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator.cs index 833e23bab..3b10a4a5a 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator.cs @@ -4,8 +4,8 @@ using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator2.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator2.cs index 1970a2ad2..c518fdda3 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator2.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/ExtensionGrantValidator2.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { @@ -21,7 +21,7 @@ public Task ValidateAsync(ExtensionGrantValidationContext context) else { // custom error message - context.Result = new GrantValidationResult(IdentityServer4.Models.TokenRequestErrors.InvalidGrant, "invalid custom credential"); + context.Result = new GrantValidationResult(ForgePoint.Identity.Models.TokenRequestErrors.InvalidGrant, "invalid custom credential"); } return Task.CompletedTask; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/NoSubjectExtensionGrantValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/NoSubjectExtensionGrantValidator.cs index b6b6c4688..a567ff27b 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/NoSubjectExtensionGrantValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/NoSubjectExtensionGrantValidator.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Scopes.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Scopes.cs index 025f6d305..09080e7ee 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Scopes.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Scopes.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Startup.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Startup.cs index 71c2dc6ae..d9ff3ce11 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Startup.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Startup.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/StartupWithCustomTokenResponses.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/StartupWithCustomTokenResponses.cs index a8a0eeb9d..8bb2c9f63 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/StartupWithCustomTokenResponses.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/StartupWithCustomTokenResponses.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/TestCustomTokenRequestValidator.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/TestCustomTokenRequestValidator.cs index c05abef7e..458561783 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/TestCustomTokenRequestValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/TestCustomTokenRequestValidator.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Users.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Users.cs index 6bb5d3b98..2c680e5c0 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Users.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/Setup/Users.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using System.Security.Claims; using IdentityModel; -using IdentityServer4; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Test; namespace IdentityServer.IntegrationTests.Clients.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/UserInfoClient.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/UserInfoClient.cs index 5fa8482f2..7d969a754 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/UserInfoClient.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Clients/UserInfoClient.cs @@ -7,6 +7,7 @@ using System.Net; using System.Net.Http; using System.Text; +using System.Text.Json; using System.Threading.Tasks; using FluentAssertions; using IdentityModel; @@ -194,7 +195,7 @@ public async Task Complex_json_should_be_correct() Token = response.AccessToken }); - roles = ((JArray)userInfo.Json["role"]).Select(x => x.ToString()).ToArray(); + roles = userInfo.Json.GetProperty("role").EnumerateArray().Select(x => x.GetString()).ToArray(); roles.Length.Should().Be(2); roles.Should().Contain("Geek"); roles.Should().Contain("Developer"); diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/IdentityServerPipeline.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/IdentityServerPipeline.cs index ef604dcad..ed0e36571 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/IdentityServerPipeline.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/IdentityServerPipeline.cs @@ -12,12 +12,12 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityModel.Client; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -332,10 +332,35 @@ public string CreateAuthorizeUrl( responseMode: responseMode, codeChallenge: codeChallenge, codeChallengeMethod: codeChallengeMethod, - extra: extra); + extra: ToParameters(extra)); return url; } + private static Parameters ToParameters(object extra) + { + if (extra == null) + { + return null; + } + + if (extra is Parameters parameters) + { + return parameters; + } + + var result = new Parameters(); + foreach (var prop in extra.GetType().GetProperties()) + { + var value = prop.GetValue(extra); + if (value != null) + { + result.Add(prop.Name, value.ToString()); + } + } + + return result; + } + public AuthorizeResponse ParseAuthorizationResponseUrl(string url) { return new AuthorizeResponse(url); diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/JsonElementExtensions.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/JsonElementExtensions.cs new file mode 100644 index 000000000..96d93b855 --- /dev/null +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/JsonElementExtensions.cs @@ -0,0 +1,66 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; + +namespace IdentityServer.IntegrationTests.Common +{ + internal static class JsonElementExtensions + { + public static T ToObject(this JsonElement element) + { + if (typeof(T) == typeof(Dictionary)) + { + return (T)(object)ToDictionary(element); + } + + return JsonSerializer.Deserialize(element.GetRawText()); + } + + public static T ToObject(this JsonElement? element) + { + if (element == null) + { + return default; + } + + return element.Value.ToObject(); + } + + public static Dictionary ToDictionary(this JsonElement element) + { + var dict = new Dictionary(); + foreach (var prop in element.EnumerateObject()) + { + dict[prop.Name] = ConvertValue(prop.Value); + } + + return dict; + } + + private static object ConvertValue(JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt64(out var l)) return l; + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Object: + return ToDictionary(element); + case JsonValueKind.Array: + return element.EnumerateArray().Select(ConvertValue).ToList(); + default: + return null; + } + } + } +} diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/TokenJson.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/TokenJson.cs new file mode 100644 index 000000000..40b66bbd8 --- /dev/null +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Common/TokenJson.cs @@ -0,0 +1,54 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Stj = System.Text.Json.JsonSerializer; + +namespace IdentityServer.IntegrationTests.Common +{ + internal static class TokenJson + { + public static List AsList(object value) + { + switch (value) + { + case null: + return null; + case JArray jarr: + return jarr.Cast().ToList(); + case JsonElement je when je.ValueKind == JsonValueKind.Array: + return Stj.Deserialize>(je.GetRawText()); + case IEnumerable enumerable when value is not string: + return enumerable.Cast().ToList(); + default: + return null; + } + } + + public static T Deserialize(object value) + { + if (value is T typed) + { + return typed; + } + + if (value is JToken token) + { + return token.ToObject(); + } + + if (value is JsonElement element) + { + return Stj.Deserialize(element.GetRawText()); + } + + return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(value)); + } + } +} diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ClientAuthenticationTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ClientAuthenticationTests.cs index 7380ac6a4..a333c9297 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ClientAuthenticationTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ClientAuthenticationTests.cs @@ -10,8 +10,8 @@ using FluentAssertions; using IdentityModel.Client; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Conformance.Basic diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/CodeFlowTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/CodeFlowTests.cs index cc3aa7189..b3af52c2c 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/CodeFlowTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/CodeFlowTests.cs @@ -12,9 +12,9 @@ using FluentAssertions; using IdentityModel.Client; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Conformance.Basic diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/RedirectUriTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/RedirectUriTests.cs index 98de207af..6e76577ee 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/RedirectUriTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/RedirectUriTests.cs @@ -9,8 +9,8 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Conformance.Basic diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ResponseTypeResponseModeTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ResponseTypeResponseModeTests.cs index e397a18c5..70437a05e 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ResponseTypeResponseModeTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Basic/ResponseTypeResponseModeTests.cs @@ -9,8 +9,8 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Conformance.Basic diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Pkce/PkceTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Pkce/PkceTests.cs index ba35f7dda..ec349dc39 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Pkce/PkceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Conformance/Pkce/PkceTests.cs @@ -11,9 +11,9 @@ using IdentityModel; using IdentityModel.Client; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Conformance.Pkce diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs index 6baefe155..0a8be4707 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs @@ -11,11 +11,11 @@ using FluentAssertions; using IdentityModel; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Default; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Default; +using ForgePoint.Identity.Test; using Microsoft.Extensions.DependencyInjection; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/ConsentTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/ConsentTests.cs index b620b1959..a33cdc289 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/ConsentTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/ConsentTests.cs @@ -9,10 +9,10 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Default; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Default; +using ForgePoint.Identity.Test; using Microsoft.Extensions.DependencyInjection; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/JwtRequestAuthorizeTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/JwtRequestAuthorizeTests.cs index 01206f02f..67ddbece6 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/JwtRequestAuthorizeTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/JwtRequestAuthorizeTests.cs @@ -13,10 +13,10 @@ using FluentAssertions; using IdentityModel; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Microsoft.IdentityModel.Logging; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; @@ -31,7 +31,7 @@ public class JwtRequestAuthorizeTests private readonly IdentityServerPipeline _mockPipeline = new IdentityServerPipeline(); private readonly Client _client; - private readonly string _symmetricJwk = @"{ 'kty': 'oct', 'use': 'sig', 'kid': '1', 'k': 'nYA-IFt8xTsdBHe9hunvizcp3Dt7f6qGqudq18kZHNtvqEGjJ9Ud-9x3kbQ-LYfLHS3xM2MpFQFg1JzT_0U_F8DI40oby4TvBDGszP664UgA8_5GjB7Flnrlsap1NlitvNpgQX3lpyTvC2zVuQ-UVsXbBDAaSBUSlnw7SE4LM8Ye2WYZrdCCXL8yAX9vIR7vf77yvNTEcBCI6y4JlvZaqMB4YKVSfygs8XqGGCHjLpE5bvI-A4ESbAUX26cVFvCeDg9pR6HK7BmwPMlO96krgtKZcXEJtUELYPys6-rbwAIdmxJxKxpgRpt0FRv_9fm6YPwG7QivYBX-vRwaodL1TA', 'alg': 'HS256'}"; + private readonly string _symmetricJwk = @"{""kty"":""oct"",""use"":""sig"",""kid"":""1"",""k"":""nYA-IFt8xTsdBHe9hunvizcp3Dt7f6qGqudq18kZHNtvqEGjJ9Ud-9x3kbQ-LYfLHS3xM2MpFQFg1JzT_0U_F8DI40oby4TvBDGszP664UgA8_5GjB7Flnrlsap1NlitvNpgQX3lpyTvC2zVuQ-UVsXbBDAaSBUSlnw7SE4LM8Ye2WYZrdCCXL8yAX9vIR7vf77yvNTEcBCI6y4JlvZaqMB4YKVSfygs8XqGGCHjLpE5bvI-A4ESbAUX26cVFvCeDg9pR6HK7BmwPMlO96krgtKZcXEJtUELYPys6-rbwAIdmxJxKxpgRpt0FRv_9fm6YPwG7QivYBX-vRwaodL1TA"",""alg"":""HS256""}"; private readonly RsaSecurityKey _rsaKey; public JwtRequestAuthorizeTests() @@ -69,13 +69,13 @@ public JwtRequestAuthorizeTests() { // RSA key as JWK Type = IdentityServerConstants.SecretTypes.JsonWebKey, - Value = JsonConvert.SerializeObject(JsonWebKeyConverter.ConvertFromRSASecurityKey(_rsaKey)) + Value = System.Text.Json.JsonSerializer.Serialize(JsonWebKeyConverter.ConvertFromRSASecurityKey(_rsaKey)) }, new Secret { // x509 cert as JWK Type = IdentityServerConstants.SecretTypes.JsonWebKey, - Value = JsonConvert.SerializeObject(JsonWebKeyConverter.ConvertFromX509SecurityKey(new X509SecurityKey(TestCert.Load()))) + Value = System.Text.Json.JsonSerializer.Serialize(JsonWebKeyConverter.ConvertFromX509SecurityKey(new X509SecurityKey(TestCert.Load()))) } }, @@ -113,13 +113,13 @@ public JwtRequestAuthorizeTests() { // RSA key as JWK Type = IdentityServerConstants.SecretTypes.JsonWebKey, - Value = JsonConvert.SerializeObject(JsonWebKeyConverter.ConvertFromRSASecurityKey(_rsaKey)) + Value = System.Text.Json.JsonSerializer.Serialize(JsonWebKeyConverter.ConvertFromRSASecurityKey(_rsaKey)) }, new Secret { // x509 cert as JWK Type = IdentityServerConstants.SecretTypes.JsonWebKey, - Value = JsonConvert.SerializeObject(JsonWebKeyConverter.ConvertFromX509SecurityKey(new X509SecurityKey(TestCert.Load()))) + Value = System.Text.Json.JsonSerializer.Serialize(JsonWebKeyConverter.ConvertFromX509SecurityKey(new X509SecurityKey(TestCert.Load()))) } }, @@ -174,12 +174,16 @@ string CreateRequestJwt(string issuer, string audience, SigningCredentials crede { var handler = new JwtSecurityTokenHandler(); handler.OutboundClaimTypeMap.Clear(); + handler.MapInboundClaims = false; + var now = DateTime.UtcNow; var token = handler.CreateJwtSecurityToken( issuer: issuer, audience: audience, signingCredentials: credential, - subject: Identity.Create("pwd", claims)); + subject: Identity.Create("pwd", claims), + notBefore: now.AddMinutes(-1), + expires: now.AddMinutes(10)); if (setJwtTyp) { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/RestrictAccessTokenViaBrowserTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/RestrictAccessTokenViaBrowserTests.cs index c154c79b2..6927e2389 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/RestrictAccessTokenViaBrowserTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/RestrictAccessTokenViaBrowserTests.cs @@ -8,9 +8,9 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Endpoints.Authorize diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/SessionIdTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/SessionIdTests.cs index 31de9fbb9..085a1c3a7 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/SessionIdTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/SessionIdTests.cs @@ -7,8 +7,8 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Endpoints.Authorize diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/DeviceAuthorization/DeviceAuthorizationTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/DeviceAuthorization/DeviceAuthorizationTests.cs index 9669d8bda..c23e11fc4 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/DeviceAuthorization/DeviceAuthorizationTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/DeviceAuthorization/DeviceAuthorizationTests.cs @@ -8,7 +8,7 @@ using FluentAssertions; using IdentityModel; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Newtonsoft.Json; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Discovery/DiscoveryEndpointTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Discovery/DiscoveryEndpointTests.cs index 1a4b3efe9..c2cf3dd34 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Discovery/DiscoveryEndpointTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Discovery/DiscoveryEndpointTests.cs @@ -5,9 +5,9 @@ using FluentAssertions; using IdentityModel.Client; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json.Linq; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/EndSession/EndSessionTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/EndSession/EndSessionTests.cs index 946a22382..99b1bc9c8 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/EndSession/EndSessionTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/EndSession/EndSessionTests.cs @@ -14,12 +14,12 @@ using FluentAssertions; using IdentityModel; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.WebUtilities; using Newtonsoft.Json.Linq; using Xunit; -using static IdentityServer4.IdentityServerConstants; +using static ForgePoint.Identity.IdentityServerConstants; namespace IdentityServer.IntegrationTests.Endpoints.EndSession { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/IntrospectionTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/IntrospectionTests.cs index edf61e872..7fc18c89e 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/IntrospectionTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/IntrospectionTests.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityModel.Client; +using IdentityServer.IntegrationTests.Common; using IdentityServer.IntegrationTests.Endpoints.Introspection.Setup; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; @@ -260,12 +261,11 @@ public async Task Response_data_should_be_valid_using_multiple_scopes_multiple_a var values = introspectionResponse.Json.ToObject>(); - values["aud"].GetType().Name.Should().Be("JArray"); - - var audiences = ((JArray)values["aud"]); + var audiences = TokenJson.AsList(values["aud"]); + audiences.Should().NotBeNull(); foreach (var aud in audiences) { - aud.Type.Should().Be(JTokenType.String); + aud.ToString().Should().NotBeNullOrEmpty(); } values["iss"].GetType().Name.Should().Be("String"); diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Clients.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Clients.cs index fb2f645fe..e5b229d4b 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Clients.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Clients.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServer.IntegrationTests.Endpoints.Introspection.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Scopes.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Scopes.cs index 7641b0ebb..080d17809 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Scopes.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Scopes.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServer.IntegrationTests.Endpoints.Introspection.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Users.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Users.cs index 9d707ae1d..ad2371bc1 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Users.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Introspection/Setup/Users.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -using IdentityServer4.Test; +using ForgePoint.Identity.Test; namespace IdentityServer.IntegrationTests.Endpoints.Introspection.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/PushedAuthorization/PushedAuthorizationEndpointTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/PushedAuthorization/PushedAuthorizationEndpointTests.cs new file mode 100644 index 000000000..abc6cb221 --- /dev/null +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/PushedAuthorization/PushedAuthorizationEndpointTests.cs @@ -0,0 +1,112 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using FluentAssertions; +using IdentityServer.IntegrationTests.Common; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; +using Xunit; + +namespace IdentityServer.IntegrationTests.Endpoints.PushedAuthorization +{ + public class PushedAuthorizationEndpointTests + { + private const string Category = "Pushed Authorization endpoint"; + + private readonly IdentityServerPipeline _pipeline = new IdentityServerPipeline(); + + public PushedAuthorizationEndpointTests() + { + _pipeline.Clients.Add(new Client + { + ClientId = "client1", + ClientSecrets = { new Secret("secret".Sha256()) }, + AllowedGrantTypes = GrantTypes.Code, + RequirePkce = false, + RedirectUris = { "https://client1/callback" }, + AllowedScopes = { "openid" } + }); + + _pipeline.IdentityScopes.Add(new IdentityResources.OpenId()); + _pipeline.Users.Add(new TestUser + { + SubjectId = "bob", + Username = "bob", + Password = "bob" + }); + + _pipeline.Initialize(); + } + + [Fact] + [Trait("Category", Category)] + public async Task discovery_should_advertise_par_endpoint() + { + var result = await _pipeline.BackChannelClient.GetAsync("https://server/.well-known/openid-configuration"); + var json = await result.Content.ReadAsStringAsync(); + var data = Newtonsoft.Json.Linq.JObject.Parse(json); + data["pushed_authorization_request_endpoint"].ToString().Should().Be("https://server/connect/par"); + } + + [Fact] + [Trait("Category", Category)] + public async Task par_should_return_request_uri_and_authorize_should_consume_it() + { + var parResponse = await _pipeline.BackChannelClient.RequestPushedAuthorizationAsync(); + parResponse.StatusCode.Should().Be(HttpStatusCode.Created); + + var json = await parResponse.Content.ReadAsStringAsync(); + json.Should().Contain("urn:ietf:params:oauth:request_uri:"); + json.Should().Contain("expires_in"); + + var requestUri = System.Text.Json.JsonDocument.Parse(json).RootElement.GetProperty("request_uri").GetString(); + var authorizeUrl = IdentityServerPipeline.AuthorizeEndpoint + + "?client_id=client1&request_uri=" + System.Net.WebUtility.UrlEncode(requestUri); + + _pipeline.BrowserClient.AllowAutoRedirect = false; + var result = await _pipeline.BrowserClient.GetAsync(authorizeUrl); + result.StatusCode.Should().Be(HttpStatusCode.Redirect); + result.Headers.Location.ToString().ToLowerInvariant().Should().Contain("/account/login"); + } + + [Fact] + [Trait("Category", Category)] + public async Task par_request_uri_is_single_use() + { + var parResponse = await _pipeline.BackChannelClient.RequestPushedAuthorizationAsync(); + var json = await parResponse.Content.ReadAsStringAsync(); + var requestUri = System.Text.Json.JsonDocument.Parse(json).RootElement.GetProperty("request_uri").GetString(); + + var authorizeUrl = IdentityServerPipeline.AuthorizeEndpoint + + "?client_id=client1&request_uri=" + System.Net.WebUtility.UrlEncode(requestUri); + + _pipeline.BrowserClient.AllowAutoRedirect = true; + var first = await _pipeline.BrowserClient.GetAsync(authorizeUrl); + first.StatusCode.Should().Be(HttpStatusCode.OK); + + var second = await _pipeline.BrowserClient.GetAsync(authorizeUrl); + _pipeline.ErrorWasCalled.Should().BeTrue(); + _pipeline.ErrorMessage.Error.Should().Be("invalid_request_uri"); + } + } + + internal static class PushedAuthorizationClientExtensions + { + public static Task RequestPushedAuthorizationAsync(this HttpClient client) + { + return client.PostAsync("https://server/connect/par", new FormUrlEncodedContent(new Dictionary + { + { "client_id", "client1" }, + { "client_secret", "secret" }, + { "response_type", "code" }, + { "redirect_uri", "https://client1/callback" }, + { "scope", "openid" } + })); + } + } +} diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Revocation/RevocationTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Revocation/RevocationTests.cs index 11a09c025..ef297a8da 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Revocation/RevocationTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Revocation/RevocationTests.cs @@ -10,8 +10,8 @@ using FluentAssertions; using IdentityModel.Client; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Endpoints.Revocation diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Token/TokenEndpointTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Token/TokenEndpointTests.cs index 222812f68..cc5df3c44 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Token/TokenEndpointTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Token/TokenEndpointTests.cs @@ -1,6 +1,6 @@ using FluentAssertions; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Net; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Extensibility/CustomProfileServiceTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Extensibility/CustomProfileServiceTests.cs index ce5d956f3..f16a2d259 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Extensibility/CustomProfileServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Extensibility/CustomProfileServiceTests.cs @@ -5,8 +5,8 @@ using FluentAssertions; using IdentityModel; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; using Xunit; @@ -38,7 +38,7 @@ public CustomProfileServiceTests() _mockPipeline.IdentityScopes.Add(new IdentityResources.OpenId()); _mockPipeline.IdentityScopes.Add(new IdentityResource("custom_identity", new string[] { "foo" })); - _mockPipeline.Users.Add(new IdentityServer4.Test.TestUser + _mockPipeline.Users.Add(new ForgePoint.Identity.Test.TestUser { SubjectId = "bob", Username = "bob", diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/IdentityServer.IntegrationTests.csproj b/src/IdentityServer4/test/IdentityServer.IntegrationTests/IdentityServer.IntegrationTests.csproj index 1848cf2e0..90eccd99f 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/IdentityServer.IntegrationTests.csproj +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/IdentityServer.IntegrationTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/CorsTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/CorsTests.cs index 9a07216f5..1ee3ec68b 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/CorsTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/CorsTests.cs @@ -9,9 +9,9 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Test; using Microsoft.Extensions.DependencyInjection; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/FederatedSignoutTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/FederatedSignoutTests.cs index 9677626fd..48aac1f69 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/FederatedSignoutTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/FederatedSignoutTests.cs @@ -11,9 +11,9 @@ using FluentAssertions; using IdentityModel; using IdentityServer.IntegrationTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Microsoft.AspNetCore.Authentication; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/SubpathHosting.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/SubpathHosting.cs index 02bc5034d..3ff10a773 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/SubpathHosting.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Pipeline/SubpathHosting.cs @@ -8,8 +8,8 @@ using FluentAssertions; using IdentityModel.Client; using IdentityServer.IntegrationTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Test; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Test; using Xunit; namespace IdentityServer.IntegrationTests.Pipeline diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockClaimsService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockClaimsService.cs index 21cb91080..3e088c335 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockClaimsService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockClaimsService.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Linq; using System.Security.Claims; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentMessageStore.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentMessageStore.cs index 9120b6dc8..d6534b407 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentMessageStore.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentMessageStore.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentService.cs index e4ac504cc..6edc31e15 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockConsentService.cs @@ -6,9 +6,9 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockHttpContextAccessor.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockHttpContextAccessor.cs index 0fdf9e9be..5db71c9c6 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockHttpContextAccessor.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockHttpContextAccessor.cs @@ -2,10 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; @@ -28,6 +29,7 @@ public MockHttpContextAccessor( var services = new ServiceCollection(); services.AddSingleton(options); + services.AddSingleton(); services.AddSingleton(Schemes); services.AddSingleton(AuthenticationService); diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockKeyMaterialService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockKeyMaterialService.cs index 5e36e138e..6a0c37dc4 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockKeyMaterialService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockKeyMaterialService.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.IdentityModel.Tokens; using System.Collections.Generic; using System.Linq; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockLogoutNotificationService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockLogoutNotificationService.cs index 350c8d4ff..394a06c2c 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockLogoutNotificationService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockLogoutNotificationService.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockMessageStore.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockMessageStore.cs index 4ea4d7497..01f7ffeb4 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockMessageStore.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockMessageStore.cs @@ -5,8 +5,8 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockPersistedGrantService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockPersistedGrantService.cs index b7ac09f4d..ad24975b2 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockPersistedGrantService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockPersistedGrantService.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockProfileService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockProfileService.cs index 9d238bdd9..a52e5dd61 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockProfileService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockProfileService.cs @@ -6,8 +6,8 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReferenceTokenStore.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReferenceTokenStore.cs index d265814f0..5f96185f6 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReferenceTokenStore.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReferenceTokenStore.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using System; using System.Threading.Tasks; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockResourceValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockResourceValidator.cs index 710a28938..07357d018 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockResourceValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockResourceValidator.cs @@ -1,4 +1,4 @@ -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReturnUrlParser.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReturnUrlParser.cs index a60994c35..157d9bf34 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReturnUrlParser.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockReturnUrlParser.cs @@ -4,8 +4,8 @@ using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockSystemClock.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockSystemClock.cs index fdd559feb..b27c118b6 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockSystemClock.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockSystemClock.cs @@ -1,9 +1,10 @@ using Microsoft.AspNetCore.Authentication; using System; +using ForgePoint.Identity; namespace IdentityServer.UnitTests.Common { - class MockSystemClock : ISystemClock + class MockSystemClock : IClock { public DateTimeOffset Now { get; set; } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockTokenCreationService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockTokenCreationService.cs index 755e65122..ed33545d3 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockTokenCreationService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockTokenCreationService.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using System.Threading.Tasks; namespace IdentityServer.UnitTests.Common diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockUserSession.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockUserSession.cs index 4154220a3..22c1b613e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockUserSession.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/MockUserSession.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authentication; namespace IdentityServer.UnitTests.Common diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubAuthorizeResponseGenerator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubAuthorizeResponseGenerator.cs index b6ce7d440..4f746a48e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubAuthorizeResponseGenerator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubAuthorizeResponseGenerator.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Validation; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubClock.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubClock.cs index 36eaee56d..bbe3e7fdd 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubClock.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubClock.cs @@ -4,10 +4,11 @@ using System; using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity; namespace IdentityServer.UnitTests.Common { - internal class StubClock : ISystemClock + internal class StubClock : IClock { public Func UtcNowFunc = () => DateTime.UtcNow; public DateTimeOffset UtcNow => new DateTimeOffset(UtcNowFunc()); diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubHandleGenerationService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubHandleGenerationService.cs index ae4d6c58a..d19a032ed 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubHandleGenerationService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/StubHandleGenerationService.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestEventService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestEventService.cs index 685ceb7cd..e15c0ea12 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestEventService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestEventService.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Events; -using IdentityServer4.Services; +using ForgePoint.Identity.Events; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestIdentityServerOptions.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestIdentityServerOptions.cs index 046be1848..ed309feab 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestIdentityServerOptions.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestIdentityServerOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestUserConsentStore.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestUserConsentStore.cs index 38ab986e6..4f74e890b 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestUserConsentStore.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Common/TestUserConsentStore.cs @@ -3,10 +3,10 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; namespace IdentityServer.UnitTests.Common { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/MockCorsPolicyService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/MockCorsPolicyService.cs index 46e1bf69f..3e84f3c34 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/MockCorsPolicyService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/MockCorsPolicyService.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Cors { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/PolicyProviderTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/PolicyProviderTests.cs index 34848cd3f..93086be48 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/PolicyProviderTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Cors/PolicyProviderTests.cs @@ -6,10 +6,10 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Configuration.DependencyInjection; -using IdentityServer4.Hosting; -using IdentityServer4.Services; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Configuration.DependencyInjection; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeCallbackEndpointTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeCallbackEndpointTests.cs index b609e3c46..c58031340 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeCallbackEndpointTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeCallbackEndpointTests.cs @@ -6,13 +6,13 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointBaseTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointBaseTests.cs index f6cdfbb2d..364f68a41 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointBaseTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointBaseTests.cs @@ -6,15 +6,15 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Hosting; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Hosting; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointTests.cs index 6b9d4b9a5..69f5e74e1 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/AuthorizeEndpointTests.cs @@ -7,12 +7,12 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeInteractionResponseGenerator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeInteractionResponseGenerator.cs index c507fcf92..4e2ec7a99 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeInteractionResponseGenerator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeInteractionResponseGenerator.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Endpoints.Authorize { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeRequestValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeRequestValidator.cs index 56ad9e278..4996847b4 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeRequestValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Authorize/StubAuthorizeRequestValidator.cs @@ -5,7 +5,7 @@ using System.Collections.Specialized; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Endpoints.Authorize { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackEndpointTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackEndpointTests.cs index 560ea4bd1..0435376e5 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackEndpointTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackEndpointTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Endpoints; +using ForgePoint.Identity.Endpoints; using Microsoft.Extensions.Logging; namespace IdentityServer.UnitTests.Endpoints.EndSession diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackResultTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackResultTests.cs index a4671c999..27c15db16 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackResultTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/EndSessionCallbackResultTests.cs @@ -5,9 +5,9 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubBackChannelLogoutClient.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubBackChannelLogoutClient.cs index 092d9511d..c0650f0e4 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubBackChannelLogoutClient.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubBackChannelLogoutClient.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Endpoints.EndSession { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubEndSessionRequestValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubEndSessionRequestValidator.cs index 951b0e28b..1b94ef070 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubEndSessionRequestValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/EndSession/StubEndSessionRequestValidator.cs @@ -5,7 +5,7 @@ using System.Collections.Specialized; using System.Security.Claims; using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Endpoints.EndSession { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/AuthorizeResultTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/AuthorizeResultTests.cs index 28839af68..dd1516ed2 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/AuthorizeResultTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/AuthorizeResultTests.cs @@ -9,12 +9,12 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.WebUtilities; using Xunit; @@ -28,7 +28,7 @@ public class AuthorizeResultTests private AuthorizeResponse _response = new AuthorizeResponse(); private IdentityServerOptions _options = new IdentityServerOptions(); private MockUserSession _mockUserSession = new MockUserSession(); - private MockMessageStore _mockErrorMessageStore = new MockMessageStore(); + private MockMessageStore _mockErrorMessageStore = new MockMessageStore(); private DefaultHttpContext _context = new DefaultHttpContext(); diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/CheckSessionResultTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/CheckSessionResultTests.cs index 38e8e0687..120fe8596 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/CheckSessionResultTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/CheckSessionResultTests.cs @@ -6,10 +6,10 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Models; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Microsoft.AspNetCore.Http; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionCallbackResultTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionCallbackResultTests.cs index 5e9fc0e8a..8f7860a51 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionCallbackResultTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionCallbackResultTests.cs @@ -7,11 +7,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionResultTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionResultTests.cs index ed199f43d..4b92758fe 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionResultTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Endpoints/Results/EndSessionResultTests.cs @@ -7,11 +7,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Endpoints.Results; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Endpoints.Results; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.WebUtilities; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ApiResourceSigningAlgorithmSelectionTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ApiResourceSigningAlgorithmSelectionTests.cs index c7512ac3d..dd1a261ce 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ApiResourceSigningAlgorithmSelectionTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ApiResourceSigningAlgorithmSelectionTests.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using FluentAssertions; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Xunit; namespace IdentityServer.UnitTests.Extensions diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/EndpointOptionsExtensionsTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/EndpointOptionsExtensionsTests.cs index 1fc853958..cae68127f 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/EndpointOptionsExtensionsTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/EndpointOptionsExtensionsTests.cs @@ -1,135 +1,135 @@ -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Hosting; using Xunit; -using static IdentityServer4.Constants; - +using static ForgePoint.Identity.Constants; + namespace IdentityServer.UnitTests.Extensions { public class EndpointOptionsExtensionsTests - { + { private readonly EndpointsOptions _options = new EndpointsOptions(); - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForAuthorizeEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableAuthorizeEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableAuthorizeEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.Authorize))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForCheckSessionEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableCheckSessionEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableCheckSessionEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.CheckSession))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForDeviceAuthorizationEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableDeviceAuthorizationEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableDeviceAuthorizationEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.DeviceAuthorization))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForDiscoveryEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableDiscoveryEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableDiscoveryEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.Discovery))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForEndSessionEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableEndSessionEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableEndSessionEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.EndSession))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForIntrospectionEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableIntrospectionEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableIntrospectionEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.Introspection))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForTokenEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableTokenEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableTokenEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.Token))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForRevocationEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableTokenRevocationEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableTokenRevocationEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.Revocation))); } - [Theory] - [InlineData(true)] + [Theory] + [InlineData(true)] [InlineData(false)] public void IsEndpointEnabledShouldReturnExpectedForUserInfoEndpoint(bool expectedIsEndpointEnabled) - { - _options.EnableUserInfoEndpoint = expectedIsEndpointEnabled; - - Assert.Equal( - expectedIsEndpointEnabled, - _options.IsEndpointEnabled( + { + _options.EnableUserInfoEndpoint = expectedIsEndpointEnabled; + + Assert.Equal( + expectedIsEndpointEnabled, + _options.IsEndpointEnabled( CreateTestEndpoint(EndpointNames.UserInfo))); - } - - private Endpoint CreateTestEndpoint(string name) - { - return new Endpoint(name, "", null); + } + + private Endpoint CreateTestEndpoint(string name) + { + return new Endpoint(name, "", null); } } } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/HttpRequestExtensionsTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/HttpRequestExtensionsTests.cs index ebf694c54..277e442a7 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/HttpRequestExtensionsTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/HttpRequestExtensionsTests.cs @@ -3,7 +3,7 @@ using FluentAssertions; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Microsoft.AspNetCore.Http; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IResourceStoreExtensionsTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IResourceStoreExtensionsTests.cs index 3276f9c8c..5462c17c4 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IResourceStoreExtensionsTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IResourceStoreExtensionsTests.cs @@ -6,8 +6,8 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Extensions diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCacheStoreTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCacheStoreTests.cs index 532af7e95..0d8870327 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCacheStoreTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCacheStoreTests.cs @@ -2,9 +2,9 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Microsoft.Extensions.DependencyInjection; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCryptoTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCryptoTests.cs index 1cad80a09..e615120ad 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCryptoTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/IdentityServerBuilderExtensionsCryptoTests.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4; -using IdentityServer4.Configuration; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.Tokens; using System; @@ -23,17 +23,17 @@ public void AddSigningCredential_with_json_web_key_containing_asymmetric_key_sho String json = @"{ - ""alg"" : ""RS256"", - ""kty"" : ""RSA"", - ""use"" : ""sig"", - ""d"" : ""KGGNkbbgm2hNMqW6fP1fmcWwEBy77WOJIPAXnDJ0KxNTtqDF8K5ULj7EElHO1A8ZnNl1Ey/x//G9lJCOQUU9wmj010dOSsW0NBbR5NtRtLLuVbkVdyft53PGeTQs+1S3c51fz9jojtNqmlfXSANPFOH6QhxmzpTx3KLsf/TpCzblkSrEGOOqCCvVdl7ybTcB230jNhh3JoL7po1rvxKtoOM4a/Bs0NtKj7e+VaHcf0GLnBPJYetsHu43ZfNejJeDoouaXZzeVEklY3B0pe10OTCIOu0JUKGZxNekklRIo1WSEYdL+CJfrSKWIv8bLj6xSr5zrASvWODyH443LN6ZvQ=="", - ""e"" : ""AQAB"", - ""n"" : ""q7mZfquRq8tzg/5slbNdQmrosNN/mFXS25dbSPm11qEDCgZa452KkO8+hvMtqa92QaqdlmalSF8+FRDOz3grDR5NtmnXZxuKnp+raKfzpC6hCvh2JSIe/J9enmsMM4YeI4d1FOSDwhJlZIYMdMnqG/VJtO1LSHjOaF3XN31ANKF0nPAsmr2/WysiQlxnxxiikLEnsFuNdS615ODDXFGTQ1E+zc4zVur4/Ox0cllPwHPA4PqoIgdPJPL+xM9IOIXuAGtsp4CYoxT6VWaRrALIZXXDY806WGTuctq4KKot6FGL9HQte2hRLl4E/r8SzIK86U3wRwrBe7saK+XUXoP0gQ="", - ""p"" : ""25dkucyCSqxRcJpRrhl7PXqw7wqBZeLQgYlZLpK493PdM8pFfq+/LK1hFtxIjdFKqXS/TOikB4YCBMEH0Im3HZ8Lo0dub3SWNhdegJyRjMbcoO+A9YSODEj7DFaNpZtdmtDi1n6etJm66ctPSR20NNpzoYZuaJ92fVQiKiOh6Qs="", - ""q"" : ""yDKBrS8l1DOx4dwP9hdwhqZJ3XahidiIZSL7m46I/6+cjaki/1mtNiA60MOgqTKegP7Fo7jAYvliqQwnvVGmQvLv19cfKywlIuKN9DdkLHnKh75hfo7aakEbO7GJ5zVgsNnKOdf8wvpclfvIuRDEVva4cksPzsJy6K7C8ENCSCM="", - ""dp"" : ""GlYJ6o6wgawxCEQ5z5uWwETau5CS/Fk7kI2ceI14SZVHzlJQC2WglAcnQcqhmQCk57Xsy5iLM6vKyi8sdMJPh+nvR2HlyNA+w7YBy4L7odqn01VmLgv7zVVjZpNq4ZXEoDC1Q+xjtF1LoYaUt7wsRLp+a7znuPyHBXj1sAAeBwk="", - ""dq"" : ""W8OK3S83T8VCTBzq1Ap6cb3XLcQq11yBaJpYaj0zXr/IKsbUW+dnFeBAFWEWS3gAX3Bod1tAFB3rs0D3FjhO1XE1ruHUT520iAEAwGiDaj+JLh994NzqELo3GW2PoIM/BtFNeKYgHd9UgQsgPnQJCzOb6Aev/z3yHeW9RRQPVbE="", - ""qi"" : ""w4KdmiDN1GtK71JxaasqmEKPNfV3v2KZDXKnfyhUsdx/idKbdTVjvMOkxFPJ4FqV4yIVn06f3QHTm4NEG18Diqxsrzd6kXQIHOa858tLsCcmt9FoGfrgCFgVceh3K/Zah/r8rl9Y61u0Z1kZumwMvFpFE+mVU01t9HgTEAVkHTc="", + ""alg"": ""RS256"", + ""kty"": ""RSA"", + ""use"": ""sig"", + ""d"": ""KGGNkbbgm2hNMqW6fP1fmcWwEBy77WOJIPAXnDJ0KxNTtqDF8K5ULj7EElHO1A8ZnNl1Ey/x//G9lJCOQUU9wmj010dOSsW0NBbR5NtRtLLuVbkVdyft53PGeTQs+1S3c51fz9jojtNqmlfXSANPFOH6QhxmzpTx3KLsf/TpCzblkSrEGOOqCCvVdl7ybTcB230jNhh3JoL7po1rvxKtoOM4a/Bs0NtKj7e+VaHcf0GLnBPJYetsHu43ZfNejJeDoouaXZzeVEklY3B0pe10OTCIOu0JUKGZxNekklRIo1WSEYdL+CJfrSKWIv8bLj6xSr5zrASvWODyH443LN6ZvQ=="", + ""e"": ""AQAB"", + ""n"": ""q7mZfquRq8tzg/5slbNdQmrosNN/mFXS25dbSPm11qEDCgZa452KkO8+hvMtqa92QaqdlmalSF8+FRDOz3grDR5NtmnXZxuKnp+raKfzpC6hCvh2JSIe/J9enmsMM4YeI4d1FOSDwhJlZIYMdMnqG/VJtO1LSHjOaF3XN31ANKF0nPAsmr2/WysiQlxnxxiikLEnsFuNdS615ODDXFGTQ1E+zc4zVur4/Ox0cllPwHPA4PqoIgdPJPL+xM9IOIXuAGtsp4CYoxT6VWaRrALIZXXDY806WGTuctq4KKot6FGL9HQte2hRLl4E/r8SzIK86U3wRwrBe7saK+XUXoP0gQ="", + ""p"": ""25dkucyCSqxRcJpRrhl7PXqw7wqBZeLQgYlZLpK493PdM8pFfq+/LK1hFtxIjdFKqXS/TOikB4YCBMEH0Im3HZ8Lo0dub3SWNhdegJyRjMbcoO+A9YSODEj7DFaNpZtdmtDi1n6etJm66ctPSR20NNpzoYZuaJ92fVQiKiOh6Qs="", + ""q"": ""yDKBrS8l1DOx4dwP9hdwhqZJ3XahidiIZSL7m46I/6+cjaki/1mtNiA60MOgqTKegP7Fo7jAYvliqQwnvVGmQvLv19cfKywlIuKN9DdkLHnKh75hfo7aakEbO7GJ5zVgsNnKOdf8wvpclfvIuRDEVva4cksPzsJy6K7C8ENCSCM="", + ""dp"": ""GlYJ6o6wgawxCEQ5z5uWwETau5CS/Fk7kI2ceI14SZVHzlJQC2WglAcnQcqhmQCk57Xsy5iLM6vKyi8sdMJPh+nvR2HlyNA+w7YBy4L7odqn01VmLgv7zVVjZpNq4ZXEoDC1Q+xjtF1LoYaUt7wsRLp+a7znuPyHBXj1sAAeBwk="", + ""dq"": ""W8OK3S83T8VCTBzq1Ap6cb3XLcQq11yBaJpYaj0zXr/IKsbUW+dnFeBAFWEWS3gAX3Bod1tAFB3rs0D3FjhO1XE1ruHUT520iAEAwGiDaj+JLh994NzqELo3GW2PoIM/BtFNeKYgHd9UgQsgPnQJCzOb6Aev/z3yHeW9RRQPVbE="", + ""qi"": ""w4KdmiDN1GtK71JxaasqmEKPNfV3v2KZDXKnfyhUsdx/idKbdTVjvMOkxFPJ4FqV4yIVn06f3QHTm4NEG18Diqxsrzd6kXQIHOa858tLsCcmt9FoGfrgCFgVceh3K/Zah/r8rl9Y61u0Z1kZumwMvFpFE+mVU01t9HgTEAVkHTc="" }"; JsonWebKey jsonWebKey = new JsonWebKey(json); diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/JwtPayloadCreationTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/JwtPayloadCreationTests.cs index 9d0179144..4ae1175b6 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/JwtPayloadCreationTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/JwtPayloadCreationTests.cs @@ -5,10 +5,9 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using Microsoft.AspNetCore.Authentication; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; using Xunit; namespace IdentityServer.UnitTests.Extensions @@ -40,7 +39,7 @@ public JwtPayloadCreationTests() public void Should_create_scopes_as_array_by_default() { var options = new IdentityServerOptions(); - var payload = _token.CreateJwtPayload(new SystemClock(), options, TestLogger.Create()); + var payload = _token.CreateJwtPayload(new StubClock(), options, TestLogger.Create()); payload.Should().NotBeNull(); var scopes = payload.Claims.Where(c => c.Type == JwtClaimTypes.Scope).ToArray(); @@ -58,12 +57,24 @@ public void Should_create_scopes_as_string() EmitScopesAsSpaceDelimitedStringInJwt = true }; - var payload = _token.CreateJwtPayload(new SystemClock(), options, TestLogger.Create()); + var payload = _token.CreateJwtPayload(new StubClock(), options, TestLogger.Create()); payload.Should().NotBeNull(); var scopes = payload.Claims.Where(c => c.Type == JwtClaimTypes.Scope).ToList(); scopes.Count().Should().Be(1); scopes.First().Value.Should().Be("scope1 scope2 scope3"); } + + [Fact] + public void Should_serialize_json_confirmation_claim() + { + _token.Confirmation = "{\"x5t#S256\":\"foo\"}"; + + var payload = _token.CreateJwtPayload(new StubClock(), new IdentityServerOptions(), TestLogger.Create()); + + payload.Should().NotBeNull(); + payload.ContainsKey(JwtClaimTypes.Confirmation).Should().BeTrue(); + payload[JwtClaimTypes.Confirmation].ToString().Should().Contain("x5t#S256"); + } } } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsIsLocalUrlTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsIsLocalUrlTests.cs new file mode 100644 index 000000000..8ef8af22a --- /dev/null +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsIsLocalUrlTests.cs @@ -0,0 +1,53 @@ +// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. +// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + + +using FluentAssertions; +using ForgePoint.Identity.Extensions; +using Xunit; + +namespace IdentityServer.UnitTests.Extensions +{ + public class StringExtensionsIsLocalUrlTests + { + [Theory] + [InlineData("/")] + [InlineData("/foo")] + [InlineData("/foo/bar")] + [InlineData("~/")] + [InlineData("~/foo")] + public void local_paths_are_accepted(string url) + { + url.IsLocalUrl().Should().BeTrue(); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData("//evil.com")] + [InlineData("/\\evil.com")] + [InlineData("~/\\evil.com")] + [InlineData("http://evil.com")] + [InlineData("https://evil.com")] + [InlineData("evil.com")] + public void non_local_urls_are_rejected(string url) + { + url.IsLocalUrl().Should().BeFalse(); + } + + [Fact] + public void urls_with_control_characters_are_rejected() + { + ("/" + '\t' + "/evil.com").IsLocalUrl().Should().BeFalse(); + ("/" + '\n' + "evil.com").IsLocalUrl().Should().BeFalse(); + ("/" + '\0' + "evil.com").IsLocalUrl().Should().BeFalse(); + ("/~/" + '\t' + "x").IsLocalUrl().Should().BeFalse(); + } + + [Fact] + public void urls_with_embedded_backslashes_are_rejected() + { + "/foo\\bar".IsLocalUrl().Should().BeFalse(); + } + } +} diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsTests.cs index ca41007ad..43f53e045 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/StringExtensionsTests.cs @@ -1,4 +1,4 @@ -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using Xunit; namespace IdentityServer.UnitTests.Extensions diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ValidatedAuthorizeRequestExtensionsTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ValidatedAuthorizeRequestExtensionsTests.cs index ebcc057b4..37299d6db 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ValidatedAuthorizeRequestExtensionsTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Extensions/ValidatedAuthorizeRequestExtensionsTests.cs @@ -1,4 +1,4 @@ -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Extensions diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Hosting/EndpointRouterTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Hosting/EndpointRouterTests.cs index 21e697a02..bdf908b3c 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Hosting/EndpointRouterTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Hosting/EndpointRouterTests.cs @@ -7,25 +7,25 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Hosting; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Hosting; using Microsoft.AspNetCore.Http; using Xunit; -using static IdentityServer4.Constants; +using static ForgePoint.Identity.Constants; namespace IdentityServer.UnitTests.Hosting { public class EndpointRouterTests { - private Dictionary _pathMap; - private List _endpoints; + private Dictionary _pathMap; + private List _endpoints; private IdentityServerOptions _options; private EndpointRouter _subject; public EndpointRouterTests() { - _pathMap = new Dictionary(); - _endpoints = new List(); + _pathMap = new Dictionary(); + _endpoints = new List(); _options = new IdentityServerOptions(); _subject = new EndpointRouter(_endpoints, _options, TestLogger.Create()); } @@ -33,15 +33,15 @@ public EndpointRouterTests() [Fact] public void Endpoint_ctor_requires_path_to_start_with_slash() { - Action a = () => new IdentityServer4.Hosting.Endpoint("ep1", "ep1", typeof(MyEndpointHandler)); + Action a = () => new ForgePoint.Identity.Hosting.Endpoint("ep1", "ep1", typeof(MyEndpointHandler)); a.Should().Throw(); } [Fact] public void Find_should_return_null_for_incorrect_path() { - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); var ctx = new DefaultHttpContext(); ctx.Request.Path = new PathString("/wrong"); @@ -54,8 +54,8 @@ public void Find_should_return_null_for_incorrect_path() [Fact] public void Find_should_find_path() { - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); var ctx = new DefaultHttpContext(); ctx.Request.Path = new PathString("/ep1"); @@ -68,8 +68,8 @@ public void Find_should_find_path() [Fact] public void Find_should_not_find_nested_paths() { - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); var ctx = new DefaultHttpContext(); ctx.Request.Path = new PathString("/ep1/subpath"); @@ -82,8 +82,8 @@ public void Find_should_not_find_nested_paths() [Fact] public void Find_should_find_first_registered_mapping() { - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep1", "/ep1", typeof(MyOtherEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep1", "/ep1", typeof(MyEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep1", "/ep1", typeof(MyOtherEndpointHandler))); var ctx = new DefaultHttpContext(); ctx.Request.Path = new PathString("/ep1"); @@ -96,8 +96,8 @@ public void Find_should_find_first_registered_mapping() [Fact] public void Find_should_return_null_for_disabled_endpoint() { - _endpoints.Add(new IdentityServer4.Hosting.Endpoint(EndpointNames.Authorize, "/ep1", typeof(MyEndpointHandler))); - _endpoints.Add(new IdentityServer4.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint(EndpointNames.Authorize, "/ep1", typeof(MyEndpointHandler))); + _endpoints.Add(new ForgePoint.Identity.Hosting.Endpoint("ep2", "/ep2", typeof(MyOtherEndpointHandler))); _options.Endpoints.EnableAuthorizeEndpoint = false; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/IdentityServer.UnitTests.csproj b/src/IdentityServer4/test/IdentityServer.UnitTests/IdentityServer.UnitTests.csproj index 073b634ac..a2d147bc7 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/IdentityServer.UnitTests.csproj +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/IdentityServer.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net10.0 diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Infrastructure/ObjectSerializerTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Infrastructure/ObjectSerializerTests.cs index 4dfb51803..62ccbf348 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Infrastructure/ObjectSerializerTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Infrastructure/ObjectSerializerTests.cs @@ -3,7 +3,7 @@ using System; using FluentAssertions; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Xunit; namespace IdentityServer.UnitTests.Infrastructure @@ -17,7 +17,7 @@ public ObjectSerializerTests() [Fact] public void Can_be_deserialize_message() { - Action a = () => IdentityServer4.ObjectSerializer.FromString>("{\"created\":0, \"data\": {\"error\": \"error\"}}"); + Action a = () => ForgePoint.Identity.ObjectSerializer.FromString>("{\"created\":0, \"data\": {\"error\": \"error\"}}"); a.Should().NotThrow(); } } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests.cs index 41a9172be..4b1a8d3e8 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests.cs @@ -7,10 +7,10 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Xunit; using static IdentityModel.OidcConstants; @@ -19,15 +19,15 @@ namespace IdentityServer.UnitTests.ResponseHandling.AuthorizeInteractionResponse public class AuthorizeInteractionResponseGeneratorTests { private IdentityServerOptions _options = new IdentityServerOptions(); - private IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator _subject; + private ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator _subject; private MockConsentService _mockConsentService = new MockConsentService(); private StubClock _clock = new StubClock(); public AuthorizeInteractionResponseGeneratorTests() { - _subject = new IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator( + _subject = new ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator( _clock, - TestLogger.Create(), + TestLogger.Create(), _mockConsentService, new MockProfileService()); } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Consent.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Consent.cs index 38fdefa15..c6ec7d5e1 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Consent.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Consent.cs @@ -10,16 +10,16 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.ResponseHandling.AuthorizeInteractionResponseGenerator { public class AuthorizeInteractionResponseGeneratorTests_Consent { - private IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator _subject; + private ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator _subject; private IdentityServerOptions _options = new IdentityServerOptions(); private MockConsentService _mockConsent = new MockConsentService(); private MockProfileService _fakeUserService = new MockProfileService(); @@ -92,9 +92,9 @@ private static IEnumerable GetScopes() public AuthorizeInteractionResponseGeneratorTests_Consent() { - _subject = new IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator( + _subject = new ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator( new StubClock(), - TestLogger.Create(), + TestLogger.Create(), _mockConsent, _fakeUserService); } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Custom.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Custom.cs index d20faf8c3..ba4064813 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Custom.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Custom.cs @@ -5,12 +5,12 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; using Xunit; @@ -18,9 +18,9 @@ namespace IdentityServer.UnitTests.ResponseHandling.AuthorizeInteractionResponseGenerator { - public class CustomAuthorizeInteractionResponseGenerator : IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator + public class CustomAuthorizeInteractionResponseGenerator : ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator { - public CustomAuthorizeInteractionResponseGenerator(ISystemClock clock, ILogger logger, IConsentService consent, IProfileService profile) : base(clock, logger, consent, profile) + public CustomAuthorizeInteractionResponseGenerator(IClock clock, ILogger logger, IConsentService consent, IProfileService profile) : base(clock, logger, consent, profile) { } @@ -57,7 +57,7 @@ public AuthorizeInteractionResponseGeneratorTests_Custom() { _subject = new CustomAuthorizeInteractionResponseGenerator( _clock, - TestLogger.Create(), + TestLogger.Create(), _mockConsentService, new MockProfileService()); } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Login.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Login.cs index a9b54d83d..52bf53dc0 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Login.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/AuthorizeInteractionResponseGenerator/AuthorizeInteractionResponseGeneratorTests_Login.cs @@ -9,10 +9,10 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.ResponseHandling.AuthorizeInteractionResponseGenerator @@ -20,15 +20,15 @@ namespace IdentityServer.UnitTests.ResponseHandling.AuthorizeInteractionResponse public class AuthorizeInteractionResponseGeneratorTests_Login { private IdentityServerOptions _options = new IdentityServerOptions(); - private IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator _subject; + private ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator _subject; private MockConsentService _mockConsentService = new MockConsentService(); private StubClock _clock = new StubClock(); public AuthorizeInteractionResponseGeneratorTests_Login() { - _subject = new IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator( + _subject = new ForgePoint.Identity.ResponseHandling.AuthorizeInteractionResponseGenerator( _clock, - TestLogger.Create(), + TestLogger.Create(), _mockConsentService, new MockProfileService()); } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/DeviceAuthorizationResponseGeneratorTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/DeviceAuthorizationResponseGeneratorTests.cs index cc0a973ad..e6c6afe66 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/DeviceAuthorizationResponseGeneratorTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/DeviceAuthorizationResponseGeneratorTests.cs @@ -8,13 +8,13 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Services; -using IdentityServer4.Services.Default; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Services.Default; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging.Abstractions; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/UserInfoResponseGeneratorTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/UserInfoResponseGeneratorTests.cs index 1c6ba6230..22350b543 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/UserInfoResponseGeneratorTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/ResponseHandling/UserInfoResponseGeneratorTests.cs @@ -9,11 +9,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.ResponseHandling; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.ResponseHandling; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.ResponseHandling diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultClaimsServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultClaimsServiceTests.cs index e5c1432a6..fed724f14 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultClaimsServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultClaimsServiceTests.cs @@ -8,11 +8,11 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Services.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultConsentServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultConsentServiceTests.cs index 2de92f8f9..c76b2bdb5 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultConsentServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultConsentServiceTests.cs @@ -9,11 +9,11 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Services.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultCorsPolicyServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultCorsPolicyServiceTests.cs index 1749bd60a..9d979cc30 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultCorsPolicyServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultCorsPolicyServiceTests.cs @@ -5,7 +5,7 @@ using System; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Xunit; namespace IdentityServer.UnitTests.Services.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultIdentityServerInteractionServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultIdentityServerInteractionServiceTests.cs index ffbe2a6c8..6553b5670 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultIdentityServerInteractionServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultIdentityServerInteractionServiceTests.cs @@ -7,11 +7,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Services.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultPersistedGrantServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultPersistedGrantServiceTests.cs index 69fa654d8..59e4431bb 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultPersistedGrantServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultPersistedGrantServiceTests.cs @@ -9,11 +9,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; using Xunit; namespace IdentityServer.UnitTests.Services.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs index 491af917b..c477af089 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs @@ -1,10 +1,10 @@ using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; using System; using System.Collections.Generic; using System.Security.Claims; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultTokenServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultTokenServiceTests.cs index e95c12301..e7bf4dd4a 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultTokenServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultTokenServiceTests.cs @@ -7,10 +7,10 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultUserSessionTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultUserSessionTests.cs index 0fc762f15..9011593c3 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultUserSessionTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DefaultUserSessionTests.cs @@ -9,10 +9,10 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Services; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Services; using Microsoft.AspNetCore.Authentication; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DistributedDeviceFlowThrottlingServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DistributedDeviceFlowThrottlingServiceTests.cs index 3484e0b6e..e12ab2f87 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DistributedDeviceFlowThrottlingServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/DistributedDeviceFlowThrottlingServiceTests.cs @@ -5,9 +5,9 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Microsoft.Extensions.Caching.Distributed; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/NumericUserCodeServiceTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/NumericUserCodeServiceTests.cs index aa1985c1c..f9a553e9a 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/NumericUserCodeServiceTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/Default/NumericUserCodeServiceTests.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Services; +using ForgePoint.Identity.Services; using Xunit; namespace IdentityServer.UnitTests.Services.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/InMemory/InMemoryCorsPolicyService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/InMemory/InMemoryCorsPolicyService.cs index 6b7288456..e9afbf8fa 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Services/InMemory/InMemoryCorsPolicyService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Services/InMemory/InMemoryCorsPolicyService.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; using Xunit; namespace IdentityServer.UnitTests.Services.InMemory diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/Default/DefaultPersistedGrantStoreTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/Default/DefaultPersistedGrantStoreTests.cs index fc8661c9d..7337e8494 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/Default/DefaultPersistedGrantStoreTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/Default/DefaultPersistedGrantStoreTests.cs @@ -9,11 +9,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; +using ForgePoint.Identity; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; using Xunit; namespace IdentityServer.UnitTests.Stores.Default diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryClientStoreTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryClientStoreTests.cs index fb2b3c9fe..75c8d0577 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryClientStoreTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryClientStoreTests.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using System; using System.Collections.Generic; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryDeviceFlowStoreTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryDeviceFlowStoreTests.cs index f95bfefb5..f085b7020 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryDeviceFlowStoreTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryDeviceFlowStoreTests.cs @@ -3,8 +3,8 @@ using System.Security.Claims; using System.Threading.Tasks; using FluentAssertions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Stores diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryPersistedGrantStoreTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryPersistedGrantStoreTests.cs index 75737b69c..78cdf041a 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryPersistedGrantStoreTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryPersistedGrantStoreTests.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; using FluentAssertions; using System.Threading.Tasks; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryResourcesStoreTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryResourcesStoreTests.cs index 0662a3e8b..196d9fb8f 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryResourcesStoreTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Stores/InMemoryResourcesStoreTests.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using System; using System.Collections.Generic; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AccessTokenValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AccessTokenValidation.cs index 3cb1b44f7..2fb291bb7 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AccessTokenValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AccessTokenValidation.cs @@ -10,9 +10,9 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Code.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Code.cs index a58cef9fb..a8aefee11 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Code.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Code.cs @@ -8,7 +8,7 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_IdToken.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_IdToken.cs index 5a2de7fe5..a86bb612f 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_IdToken.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_IdToken.cs @@ -8,7 +8,7 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Invalid.cs index 3829cc1ad..78a026c5e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Invalid.cs @@ -8,7 +8,7 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Token.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Token.cs index 533b2e831..e28432f5e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Token.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Token.cs @@ -8,7 +8,7 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Valid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Valid.cs index c6893bef4..a5cea893f 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Valid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ClientValidation_Valid.cs @@ -8,7 +8,7 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_CustomValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_CustomValidator.cs index d4ada7e39..3529ef7b5 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_CustomValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_CustomValidator.cs @@ -8,7 +8,7 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Invalid.cs index 97c9368ba..a7515f484 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Invalid.cs @@ -8,7 +8,7 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; +using ForgePoint.Identity; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_PKCE.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_PKCE.cs index 73c593ebb..9da0d44ac 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_PKCE.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_PKCE.cs @@ -8,7 +8,7 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; +using ForgePoint.Identity.Configuration; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Valid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Valid.cs index a0e093146..2421732b2 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Valid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/AuthorizeRequest Validation/Authorize_ProtocolValidation_Valid.cs @@ -8,7 +8,7 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; +using ForgePoint.Identity; using Xunit; namespace IdentityServer.UnitTests.Validation.AuthorizeRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/BearerTokenUsageValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/BearerTokenUsageValidation.cs index c73578fa3..3d26e0994 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/BearerTokenUsageValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/BearerTokenUsageValidation.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ClientConfigurationValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ClientConfigurationValidation.cs index f5fc25788..cda1eae4a 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ClientConfigurationValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ClientConfigurationValidation.cs @@ -3,9 +3,9 @@ using FluentAssertions; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System; using System.Threading.Tasks; using IdentityServer.UnitTests.Validation.Setup; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceAuthorizationRequestValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceAuthorizationRequestValidation.cs index 08e7faf6c..d0ccc1fa2 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceAuthorizationRequestValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceAuthorizationRequestValidation.cs @@ -9,9 +9,9 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceCodeValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceCodeValidation.cs index 828d8b587..98c3779cb 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceCodeValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/DeviceCodeValidation.cs @@ -8,10 +8,10 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/EndSessionRequestValidatorTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/EndSessionRequestValidatorTests.cs index d28ddd91e..5a45098b2 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/EndSessionRequestValidatorTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/EndSessionRequestValidatorTests.cs @@ -8,11 +8,11 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation.EndSessionRequestValidation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubRedirectUriValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubRedirectUriValidator.cs index ba4edd7db..eca88e463 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubRedirectUriValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubRedirectUriValidator.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Validation.EndSessionRequestValidation { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubTokenValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubTokenValidator.cs index 4f3193f57..b72ed7aca 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubTokenValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/EndSessionRequestValidation/StubTokenValidator.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Validation.EndSessionRequestValidation { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/GrantTypesValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/GrantTypesValidation.cs index 1b6a5535e..f9870697e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/GrantTypesValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/GrantTypesValidation.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using FluentAssertions; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/IntrospectionRequestValidatorTests.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/IntrospectionRequestValidatorTests.cs index 0792ce33a..d778b12c0 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/IntrospectionRequestValidatorTests.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/IntrospectionRequestValidatorTests.cs @@ -9,9 +9,9 @@ using FluentAssertions; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResourceValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResourceValidation.cs index c604dcc83..254be10d4 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResourceValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResourceValidation.cs @@ -7,9 +7,9 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Extensions; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation @@ -132,7 +132,7 @@ public async Task Only_Offline_Access_Requested() var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -149,7 +149,7 @@ public async Task All_Scopes_Valid() var scopes = "openid resource1".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -167,7 +167,7 @@ public async Task Invalid_Scope() var scopes = "openid email resource1 unknown".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -181,7 +181,7 @@ public async Task Invalid_Scope() var scopes = "openid resource1 resource2".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -194,7 +194,7 @@ public async Task Invalid_Scope() var scopes = "openid email resource1".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -212,7 +212,7 @@ public async Task Disabled_Scope() var scopes = "openid resource1 disabled".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -229,7 +229,7 @@ public async Task All_Scopes_Allowed_For_Restricted_Client() var scopes = "openid resource1".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -246,7 +246,7 @@ public async Task Restricted_Scopes() var scopes = "openid email resource1 resource2".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -264,7 +264,7 @@ public async Task Contains_Resource_and_Identity_Scopes() var scopes = "openid resource1".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -282,7 +282,7 @@ public async Task Contains_Resource_Scopes_Only() var scopes = "resource1".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -300,7 +300,7 @@ public async Task Contains_Identity_Scopes_Only() var scopes = "openid".ParseScopesString(); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = _restrictedClient, Scopes = scopes @@ -322,7 +322,7 @@ public async Task Scope_matches_multipls_apis_should_succeed() _scopes.Add(new ApiScope("resource")); var validator = Factory.CreateResourceValidator(_store); - var result = await validator.ValidateRequestedResourcesAsync(new IdentityServer4.Validation.ResourceValidationRequest + var result = await validator.ValidateRequestedResourcesAsync(new ForgePoint.Identity.Validation.ResourceValidationRequest { Client = new Client { AllowedScopes = { "resource" } }, Scopes = new[] { "resource" } diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResponseTypeEqualityComparison.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResponseTypeEqualityComparison.cs index 163e5b48d..40e71cc76 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResponseTypeEqualityComparison.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/ResponseTypeEqualityComparison.cs @@ -3,7 +3,7 @@ using FluentAssertions; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/RevocationRequestValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/RevocationRequestValidation.cs index bb7d71427..6f6ec5b9d 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/RevocationRequestValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/RevocationRequestValidation.cs @@ -8,9 +8,9 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/BasicAuthenticationCredentialParsing.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/BasicAuthenticationCredentialParsing.cs index b71514f2f..8109f9616 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/BasicAuthenticationCredentialParsing.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/BasicAuthenticationCredentialParsing.cs @@ -6,9 +6,9 @@ using System.Text; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/ClientAssertionSecretParsing.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/ClientAssertionSecretParsing.cs index 3d355d5ac..4e42d36df 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/ClientAssertionSecretParsing.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/ClientAssertionSecretParsing.cs @@ -8,9 +8,9 @@ using System.Text; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/FormPostCredentialParsing.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/FormPostCredentialParsing.cs index 123df5781..aa15709b3 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/FormPostCredentialParsing.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/FormPostCredentialParsing.cs @@ -6,9 +6,9 @@ using System.Text; using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/HashedSharedSecretValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/HashedSharedSecretValidation.cs index 0d5e0254c..df34efbf7 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/HashedSharedSecretValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/HashedSharedSecretValidation.cs @@ -5,10 +5,10 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/MutualTlsSecretValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/MutualTlsSecretValidation.cs index 1b22ff1e6..00a2286ef 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/MutualTlsSecretValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/MutualTlsSecretValidation.cs @@ -7,10 +7,10 @@ using FluentAssertions; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PlainTextClientSecretValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PlainTextClientSecretValidation.cs index 88466b220..fb7f4538e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PlainTextClientSecretValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PlainTextClientSecretValidation.cs @@ -5,10 +5,10 @@ using System.Threading.Tasks; using FluentAssertions; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PrivateKeyJwtSecretValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PrivateKeyJwtSecretValidation.cs index 7d4886b6f..41a6e6789 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PrivateKeyJwtSecretValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/PrivateKeyJwtSecretValidation.cs @@ -12,12 +12,12 @@ using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Services.Default; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Tokens; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/SecretValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/SecretValidation.cs index 2d2845456..025ccbe77 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/SecretValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Secrets/SecretValidation.cs @@ -6,11 +6,11 @@ using FluentAssertions; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Microsoft.Extensions.Logging; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ClientValidationTestClients.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ClientValidationTestClients.cs index 3cc859c67..b1bd70207 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ClientValidationTestClients.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ClientValidationTestClients.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; using IdentityServer.UnitTests.Common; -using IdentityServer4; -using IdentityServer4.Models; -using static IdentityServer4.IdentityServerConstants; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using static ForgePoint.Identity.IdentityServerConstants; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs index 2723eb2da..cddcc5c04 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/Factory.cs @@ -7,15 +7,16 @@ using System.Linq; using System.Net.Http; using IdentityServer.UnitTests.Common; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Services.Default; -using IdentityServer4.Stores; -using IdentityServer4.Stores.Serialization; -using IdentityServer4.Validation; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; +using ForgePoint.Identity.Services.Default; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Stores.Serialization; +using ForgePoint.Identity.Validation; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; +using ForgePoint.Identity; namespace IdentityServer.UnitTests.Validation.Setup { @@ -229,8 +230,8 @@ public static AuthorizeRequestValidator CreateAuthorizeRequestValidator( jwtRequestUriHttpClient = new DefaultJwtRequestUriHttpClient(new HttpClient(new NetworkHandler(new Exception("no jwt request uri response configured"))), options, new LoggerFactory()); } - var userSession = new MockUserSession(); + var pushedAuthorizationStore = new InMemoryPushedAuthorizationStore(); return new AuthorizeRequestValidator( options, @@ -241,6 +242,7 @@ public static AuthorizeRequestValidator CreateAuthorizeRequestValidator( userSession, jwtRequestValidator, jwtRequestUriHttpClient, + pushedAuthorizationStore, TestLogger.Create()); } @@ -248,7 +250,7 @@ public static TokenValidator CreateTokenValidator( IReferenceTokenStore store = null, IRefreshTokenStore refreshTokenStore = null, IProfileService profile = null, - IdentityServerOptions options = null, ISystemClock clock = null) + IdentityServerOptions options = null, IClock clock = null) { if (options == null) { @@ -301,7 +303,7 @@ public static IDeviceCodeValidator CreateDeviceCodeValidator( IDeviceFlowCodeService service, IProfileService profile = null, IDeviceFlowThrottlingService throttlingService = null, - ISystemClock clock = null) + IClock clock = null) { profile = profile ?? new TestProfileService(); throttlingService = throttlingService ?? new TestDeviceFlowThrottlingService(); diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestClients.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestClients.cs index 6fbb8939f..02b68369a 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestClients.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestClients.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; -using IdentityServer4; -using IdentityServer4.Models; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceCodeValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceCodeValidator.cs index 7a3188266..63e96b894 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceCodeValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceCodeValidator.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using IdentityServer4.Validation; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceFlowThrottlingService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceFlowThrottlingService.cs index a4421cdc1..716229270 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceFlowThrottlingService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestDeviceFlowThrottlingService.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestGrantValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestGrantValidator.cs index 33f88961d..58e18acd8 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestGrantValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestGrantValidator.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestProfileService.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestProfileService.cs index 76663262a..0a630498d 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestProfileService.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestProfileService.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Services; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestResourceOwnerPasswordValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestResourceOwnerPasswordValidator.cs index a37aa0ea2..9434f98bb 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestResourceOwnerPasswordValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestResourceOwnerPasswordValidator.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestScopes.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestScopes.cs index 58b6d2d10..ff0b50e75 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestScopes.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestScopes.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestTokenValidator.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestTokenValidator.cs index 3b3554223..9351fab5e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestTokenValidator.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TestTokenValidator.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System.Threading.Tasks; namespace IdentityServer.UnitTests.Validation.Setup diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TokenFactory.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TokenFactory.cs index dfb4516de..f683c900c 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TokenFactory.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/TokenFactory.cs @@ -8,7 +8,7 @@ using System.Security.Claims; using IdentityModel; using IdentityServer.UnitTests.Common; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ValidationExtensions.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ValidationExtensions.cs index 06433041a..7755accda 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ValidationExtensions.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/Setup/ValidationExtensions.cs @@ -1,5 +1,5 @@ -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; namespace IdentityServer.UnitTests.Validation.Setup { diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/StrictRedirectUriValidatorAppAuthValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/StrictRedirectUriValidatorAppAuthValidation.cs index 27d9fbe0a..0f48844da 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/StrictRedirectUriValidatorAppAuthValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/StrictRedirectUriValidatorAppAuthValidation.cs @@ -1,7 +1,7 @@ using FluentAssertions; using IdentityServer.UnitTests.Common; -using IdentityServer4.Models; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Threading.Tasks; using Xunit; diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ClientCredentials_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ClientCredentials_Invalid.cs index c758a8571..ed9ed03be 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ClientCredentials_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ClientCredentials_Invalid.cs @@ -8,7 +8,7 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Stores; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Code_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Code_Invalid.cs index f3293feec..89b02ec3e 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Code_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Code_Invalid.cs @@ -11,10 +11,10 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_DeviceCode_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_DeviceCode_Invalid.cs index da5b063b3..9f69ccd6f 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_DeviceCode_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_DeviceCode_Invalid.cs @@ -9,10 +9,10 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ExtensionGrants_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ExtensionGrants_Invalid.cs index 452aa3fda..18ba62715 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ExtensionGrants_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ExtensionGrants_Invalid.cs @@ -7,7 +7,7 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Stores; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_General_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_General_Invalid.cs index 6348c6fd6..c788886b3 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_General_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_General_Invalid.cs @@ -9,9 +9,9 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_PKCE.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_PKCE.cs index 48db2692d..26568c2ec 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_PKCE.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_PKCE.cs @@ -11,10 +11,10 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_RefreshToken_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_RefreshToken_Invalid.cs index b6fc6b799..e7719b24c 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_RefreshToken_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_RefreshToken_Invalid.cs @@ -11,9 +11,9 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Configuration; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity.Configuration; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ResourceOwner_Invalid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ResourceOwner_Invalid.cs index 7594310a6..cfb00c5c1 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ResourceOwner_Invalid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_ResourceOwner_Invalid.cs @@ -8,9 +8,9 @@ using IdentityModel; using IdentityServer.UnitTests.Common; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Valid.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Valid.cs index 9133fc1cf..c4e07bc23 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Valid.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/TokenRequest Validation/TokenRequestValidation_Valid.cs @@ -10,9 +10,9 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4; -using IdentityServer4.Models; -using IdentityServer4.Stores; +using ForgePoint.Identity; +using ForgePoint.Identity.Models; +using ForgePoint.Identity.Stores; using Xunit; namespace IdentityServer.UnitTests.Validation.TokenRequest_Validation diff --git a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/UserInfoRequestValidation.cs b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/UserInfoRequestValidation.cs index 061fb2931..74075187d 100644 --- a/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/UserInfoRequestValidation.cs +++ b/src/IdentityServer4/test/IdentityServer.UnitTests/Validation/UserInfoRequestValidation.cs @@ -5,8 +5,8 @@ using FluentAssertions; using IdentityModel; using IdentityServer.UnitTests.Validation.Setup; -using IdentityServer4.Stores; -using IdentityServer4.Validation; +using ForgePoint.Identity.Stores; +using ForgePoint.Identity.Validation; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; diff --git a/src/Storage/README.md b/src/Storage/README.md index 45cb24af2..901cb2585 100644 --- a/src/Storage/README.md +++ b/src/Storage/README.md @@ -1,3 +1,3 @@ -# IdentityServer4.Storage +# ForgePoint.Identity.Storage -IdentityServer4.Storage contains all the models and storage interfaces for IdentityServer 4 configuration data. \ No newline at end of file +ForgePoint.Identity.Storage contains the models and storage interfaces for ForgePoint.Identity configuration data. Namespaces are `ForgePoint.Identity.*`. diff --git a/src/Storage/build/Program.cs b/src/Storage/build/Program.cs index de9c5bd51..5f42fc070 100644 --- a/src/Storage/build/Program.cs +++ b/src/Storage/build/Program.cs @@ -2,6 +2,6 @@ { partial class Program { - private const string Prefix = "Storage"; + private const string Prefix = "ForgePoint.Identity.Storage"; } } diff --git a/src/Storage/build/build.csproj b/src/Storage/build/build.csproj index 43c81aaed..f1804320d 100644 --- a/src/Storage/build/build.csproj +++ b/src/Storage/build/build.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net10.0 diff --git a/src/Storage/src/Constants.cs b/src/Storage/src/Constants.cs index 92f83e4fe..f91f0d47e 100644 --- a/src/Storage/src/Constants.cs +++ b/src/Storage/src/Constants.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4 +namespace ForgePoint.Identity { internal static class Constants { - public const string IdentityServerName = "IdentityServer4"; + public const string IdentityServerName = "ForgePoint.Identity"; public const string IdentityServerAuthenticationType = IdentityServerName; } } \ No newline at end of file diff --git a/src/Storage/src/Extensions/IEnumerableExtensions.cs b/src/Storage/src/Extensions/IEnumerableExtensions.cs index 84fcc8508..cc6e55091 100644 --- a/src/Storage/src/Extensions/IEnumerableExtensions.cs +++ b/src/Storage/src/Extensions/IEnumerableExtensions.cs @@ -8,7 +8,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { internal static class IEnumerableExtensions { diff --git a/src/Storage/src/Extensions/PersistedGrantFilterExtensions.cs b/src/Storage/src/Extensions/PersistedGrantFilterExtensions.cs index 8b9666a06..3fc35ec38 100644 --- a/src/Storage/src/Extensions/PersistedGrantFilterExtensions.cs +++ b/src/Storage/src/Extensions/PersistedGrantFilterExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Stores; +using ForgePoint.Identity.Stores; using System; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { /// /// Extensions for PersistedGrantFilter. diff --git a/src/Storage/src/Extensions/StringsExtensions.cs b/src/Storage/src/Extensions/StringsExtensions.cs index 8f66fa7da..370aa9441 100644 --- a/src/Storage/src/Extensions/StringsExtensions.cs +++ b/src/Storage/src/Extensions/StringsExtensions.cs @@ -4,7 +4,7 @@ using System.Diagnostics; -namespace IdentityServer4.Extensions +namespace ForgePoint.Identity.Extensions { internal static class StringExtensions { diff --git a/src/Storage/src/IdentityServer4.Storage.csproj b/src/Storage/src/IdentityServer4.Storage.csproj index dbc2a6fe9..8f566f429 100644 --- a/src/Storage/src/IdentityServer4.Storage.csproj +++ b/src/Storage/src/IdentityServer4.Storage.csproj @@ -1,17 +1,16 @@  - netstandard2.0 + net8.0;net10.0 - IdentityServer4.Storage - Storage interfaces and models for IdentityServer4 - Brock Allen;Dominick Baier + ForgePoint.Identity.Storage + Storage interfaces and models for ForgePoint.Identity + ForgePoint.Identity.Storage + ForgePoint.Identity - OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;IdentityServer + OAuth2;OAuth 2.0;OpenID Connect;Security;Identity;ForgePoint;IdentityServer4 icon.jpg - https://github.com/IdentityServer/IdentityServer4 Apache-2.0 - https://github.com/IdentityServer/IdentityServer4/releases true true @@ -35,6 +34,7 @@ + diff --git a/src/Storage/src/IdentityServerConstants.cs b/src/Storage/src/IdentityServerConstants.cs index 642d272c4..a0e06d1a6 100644 --- a/src/Storage/src/IdentityServerConstants.cs +++ b/src/Storage/src/IdentityServerConstants.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4 +namespace ForgePoint.Identity { internal static class IdentityServerConstants { diff --git a/src/Storage/src/IdentityServerUser.cs b/src/Storage/src/IdentityServerUser.cs index 75f96bf5a..dacd28fab 100644 --- a/src/Storage/src/IdentityServerUser.cs +++ b/src/Storage/src/IdentityServerUser.cs @@ -3,13 +3,13 @@ using IdentityModel; -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; -namespace IdentityServer4 +namespace ForgePoint.Identity { /// /// Model properties of an IdentityServer user diff --git a/src/Storage/src/Models/ApiResource.cs b/src/Storage/src/Models/ApiResource.cs index 2790b8a4e..66401f2da 100644 --- a/src/Storage/src/Models/ApiResource.cs +++ b/src/Storage/src/Models/ApiResource.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Diagnostics; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a web API resource. diff --git a/src/Storage/src/Models/ApiScope.cs b/src/Storage/src/Models/ApiScope.cs index 44c995d76..4598bdc65 100644 --- a/src/Storage/src/Models/ApiScope.cs +++ b/src/Storage/src/Models/ApiScope.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Diagnostics; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models access to an API scope diff --git a/src/Storage/src/Models/AuthorizationCode.cs b/src/Storage/src/Models/AuthorizationCode.cs index 1ab7cd519..fce9aa3b8 100644 --- a/src/Storage/src/Models/AuthorizationCode.cs +++ b/src/Storage/src/Models/AuthorizationCode.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models an authorization code. diff --git a/src/Storage/src/Models/Client.cs b/src/Storage/src/Models/Client.cs index 1a0a0e7e4..daea0b495 100644 --- a/src/Storage/src/Models/Client.cs +++ b/src/Storage/src/Models/Client.cs @@ -8,7 +8,7 @@ using System.Collections; using System.Diagnostics; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models an OpenID Connect or OAuth2 client @@ -106,6 +106,11 @@ public ICollection AllowedGrantTypes /// Specifies whether the client must use a request object on authorize requests (defaults to false.) /// public bool RequireRequestObject { get; set; } = false; + + /// + /// Specifies whether the client must use pushed authorization requests (RFC 9126). Defaults to false. + /// + public bool RequirePushedAuthorization { get; set; } = false; /// /// Controls whether access tokens are transmitted via the browser for this client (defaults to false). diff --git a/src/Storage/src/Models/ClientClaim.cs b/src/Storage/src/Models/ClientClaim.cs index b71d5b99d..751433994 100644 --- a/src/Storage/src/Models/ClientClaim.cs +++ b/src/Storage/src/Models/ClientClaim.cs @@ -5,7 +5,7 @@ using System; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// A client claim diff --git a/src/Storage/src/Models/Consent.cs b/src/Storage/src/Models/Consent.cs index 7a0df3af6..8adda85b8 100644 --- a/src/Storage/src/Models/Consent.cs +++ b/src/Storage/src/Models/Consent.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Represents the permissions (in terms of scopes) granted to a client by a subject diff --git a/src/Storage/src/Models/DeviceCode.cs b/src/Storage/src/Models/DeviceCode.cs index f4c25d0d8..9129c143d 100644 --- a/src/Storage/src/Models/DeviceCode.cs +++ b/src/Storage/src/Models/DeviceCode.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Represents data needed for device flow. diff --git a/src/Storage/src/Models/Enums.cs b/src/Storage/src/Models/Enums.cs index 9531bcb26..63a147c45 100644 --- a/src/Storage/src/Models/Enums.cs +++ b/src/Storage/src/Models/Enums.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// OpenID Connect subject types. diff --git a/src/Storage/src/Models/GrantType.cs b/src/Storage/src/Models/GrantType.cs index 9655699aa..0c08fd5dd 100644 --- a/src/Storage/src/Models/GrantType.cs +++ b/src/Storage/src/Models/GrantType.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { public static class GrantType { diff --git a/src/Storage/src/Models/IdentityResource.cs b/src/Storage/src/Models/IdentityResource.cs index 21b93298e..acc94b80e 100644 --- a/src/Storage/src/Models/IdentityResource.cs +++ b/src/Storage/src/Models/IdentityResource.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Extensions; +using ForgePoint.Identity.Extensions; using System; using System.Collections.Generic; using System.Diagnostics; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a user identity resource. diff --git a/src/Storage/src/Models/PersistedGrant.cs b/src/Storage/src/Models/PersistedGrant.cs index 2c2015aaa..430f31c8a 100644 --- a/src/Storage/src/Models/PersistedGrant.cs +++ b/src/Storage/src/Models/PersistedGrant.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// A model for a persisted grant diff --git a/src/Storage/src/Models/RefreshToken.cs b/src/Storage/src/Models/RefreshToken.cs index 4f3876e3b..049c5777a 100644 --- a/src/Storage/src/Models/RefreshToken.cs +++ b/src/Storage/src/Models/RefreshToken.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a refresh token. diff --git a/src/Storage/src/Models/Resource.cs b/src/Storage/src/Models/Resource.cs index d2c775a67..c8981897a 100644 --- a/src/Storage/src/Models/Resource.cs +++ b/src/Storage/src/Models/Resource.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models the common data of API and identity resources. diff --git a/src/Storage/src/Models/Resources.cs b/src/Storage/src/Models/Resources.cs index 708e9383c..71a6382d3 100644 --- a/src/Storage/src/Models/Resources.cs +++ b/src/Storage/src/Models/Resources.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a collection of identity and API resources. diff --git a/src/Storage/src/Models/Secret.cs b/src/Storage/src/Models/Secret.cs index f578d6925..51bf056a4 100644 --- a/src/Storage/src/Models/Secret.cs +++ b/src/Storage/src/Models/Secret.cs @@ -4,7 +4,7 @@ using System; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a client secret with identifier and expiration diff --git a/src/Storage/src/Models/Token.cs b/src/Storage/src/Models/Token.cs index 505e8e7db..0af14bcad 100644 --- a/src/Storage/src/Models/Token.cs +++ b/src/Storage/src/Models/Token.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Security.Claims; -namespace IdentityServer4.Models +namespace ForgePoint.Identity.Models { /// /// Models a token. diff --git a/src/Storage/src/Services/ICorsPolicyService.cs b/src/Storage/src/Services/ICorsPolicyService.cs index 8029af398..e2cfbf30b 100644 --- a/src/Storage/src/Services/ICorsPolicyService.cs +++ b/src/Storage/src/Services/ICorsPolicyService.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; -namespace IdentityServer4.Services +namespace ForgePoint.Identity.Services { /// /// Service that determines if CORS is allowed. diff --git a/src/Storage/src/Stores/IAuthorizationCodeStore.cs b/src/Storage/src/Stores/IAuthorizationCodeStore.cs index fd7c0a71b..17005e698 100644 --- a/src/Storage/src/Stores/IAuthorizationCodeStore.cs +++ b/src/Storage/src/Stores/IAuthorizationCodeStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for the authorization code store diff --git a/src/Storage/src/Stores/IClientStore.cs b/src/Storage/src/Stores/IClientStore.cs index 3735d4948..5c2fcb7a6 100644 --- a/src/Storage/src/Stores/IClientStore.cs +++ b/src/Storage/src/Stores/IClientStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Retrieval of client configuration diff --git a/src/Storage/src/Stores/IDeviceFlowStore.cs b/src/Storage/src/Stores/IDeviceFlowStore.cs index a827debb5..0e476c9df 100644 --- a/src/Storage/src/Stores/IDeviceFlowStore.cs +++ b/src/Storage/src/Stores/IDeviceFlowStore.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; -using IdentityServer4.Models; +using ForgePoint.Identity.Models; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for the device flow store diff --git a/src/Storage/src/Stores/IPersistedGrantStore.cs b/src/Storage/src/Stores/IPersistedGrantStore.cs index ca53d3426..d5065b1e6 100644 --- a/src/Storage/src/Stores/IPersistedGrantStore.cs +++ b/src/Storage/src/Stores/IPersistedGrantStore.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for persisting any type of grant. diff --git a/src/Storage/src/Stores/IReferenceTokenStore.cs b/src/Storage/src/Stores/IReferenceTokenStore.cs index b0f3f5491..55df2df85 100644 --- a/src/Storage/src/Stores/IReferenceTokenStore.cs +++ b/src/Storage/src/Stores/IReferenceTokenStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for reference token storage diff --git a/src/Storage/src/Stores/IRefreshTokenStore.cs b/src/Storage/src/Stores/IRefreshTokenStore.cs index 72712f45e..0c82987fe 100644 --- a/src/Storage/src/Stores/IRefreshTokenStore.cs +++ b/src/Storage/src/Stores/IRefreshTokenStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for refresh token storage diff --git a/src/Storage/src/Stores/IResourceStore.cs b/src/Storage/src/Stores/IResourceStore.cs index b593ee01a..6367fe327 100644 --- a/src/Storage/src/Stores/IResourceStore.cs +++ b/src/Storage/src/Stores/IResourceStore.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Collections.Generic; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Resource retrieval diff --git a/src/Storage/src/Stores/IUserConsentStore.cs b/src/Storage/src/Stores/IUserConsentStore.cs index 2a96eec85..a675c6348 100644 --- a/src/Storage/src/Stores/IUserConsentStore.cs +++ b/src/Storage/src/Stores/IUserConsentStore.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using ForgePoint.Identity.Models; using System.Threading.Tasks; -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Interface for user consent storage diff --git a/src/Storage/src/Stores/PersistedGrantFilter.cs b/src/Storage/src/Stores/PersistedGrantFilter.cs index 9501495ff..b9aef131e 100644 --- a/src/Storage/src/Stores/PersistedGrantFilter.cs +++ b/src/Storage/src/Stores/PersistedGrantFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Stores +namespace ForgePoint.Identity.Stores { /// /// Represents a filter used when accessing the persisted grants store. diff --git a/src/Storage/src/Stores/Serialization/ClaimConverter.cs b/src/Storage/src/Stores/Serialization/ClaimConverter.cs index c41fbabb7..fbe59760a 100644 --- a/src/Storage/src/Stores/Serialization/ClaimConverter.cs +++ b/src/Storage/src/Stores/Serialization/ClaimConverter.cs @@ -8,7 +8,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { public class ClaimConverter : JsonConverter { diff --git a/src/Storage/src/Stores/Serialization/ClaimLite.cs b/src/Storage/src/Stores/Serialization/ClaimLite.cs index 882578970..0ed18b1ad 100644 --- a/src/Storage/src/Stores/Serialization/ClaimLite.cs +++ b/src/Storage/src/Stores/Serialization/ClaimLite.cs @@ -4,7 +4,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { public class ClaimLite { diff --git a/src/Storage/src/Stores/Serialization/ClaimsPrincipalConverter.cs b/src/Storage/src/Stores/Serialization/ClaimsPrincipalConverter.cs index 40d5ed7d9..d363a8bae 100644 --- a/src/Storage/src/Stores/Serialization/ClaimsPrincipalConverter.cs +++ b/src/Storage/src/Stores/Serialization/ClaimsPrincipalConverter.cs @@ -10,7 +10,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { public class ClaimsPrincipalConverter : JsonConverter { diff --git a/src/Storage/src/Stores/Serialization/ClaimsPrincipalLite.cs b/src/Storage/src/Stores/Serialization/ClaimsPrincipalLite.cs index 2e8d09528..9d4c30eb1 100644 --- a/src/Storage/src/Stores/Serialization/ClaimsPrincipalLite.cs +++ b/src/Storage/src/Stores/Serialization/ClaimsPrincipalLite.cs @@ -3,7 +3,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { public class ClaimsPrincipalLite { diff --git a/src/Storage/src/Stores/Serialization/CustomContractResolver.cs b/src/Storage/src/Stores/Serialization/CustomContractResolver.cs index a2e23634a..536efcd90 100644 --- a/src/Storage/src/Stores/Serialization/CustomContractResolver.cs +++ b/src/Storage/src/Stores/Serialization/CustomContractResolver.cs @@ -10,7 +10,7 @@ #pragma warning disable 1591 -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { public class CustomContractResolver: DefaultContractResolver { diff --git a/src/Storage/src/Stores/Serialization/IPersistentGrantSerializer.cs b/src/Storage/src/Stores/Serialization/IPersistentGrantSerializer.cs index eb092381e..1afb93966 100644 --- a/src/Storage/src/Stores/Serialization/IPersistentGrantSerializer.cs +++ b/src/Storage/src/Stores/Serialization/IPersistentGrantSerializer.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { /// /// Interface for persisted grant serialization diff --git a/src/Storage/src/Stores/Serialization/PersistentGrantSerializer.cs b/src/Storage/src/Stores/Serialization/PersistentGrantSerializer.cs index 022403f46..70874afcf 100644 --- a/src/Storage/src/Stores/Serialization/PersistentGrantSerializer.cs +++ b/src/Storage/src/Stores/Serialization/PersistentGrantSerializer.cs @@ -4,12 +4,12 @@ using Newtonsoft.Json; -namespace IdentityServer4.Stores.Serialization +namespace ForgePoint.Identity.Stores.Serialization { /// /// JSON-based persisted grant serializer /// - /// + /// public class PersistentGrantSerializer : IPersistentGrantSerializer { private static readonly JsonSerializerSettings _settings; diff --git a/src/build/Program.Partial.cs b/src/build/Program.Partial.cs index bade30f96..1669e61de 100644 --- a/src/build/Program.Partial.cs +++ b/src/build/Program.Partial.cs @@ -97,7 +97,7 @@ private static void Sign(string path, string searchTerm) foreach (var file in Directory.GetFiles(path, searchTerm, SearchOption.AllDirectories)) { Console.WriteLine($" Signing {file}"); - Run("dotnet", $"SignClient sign -c ../../signClient.json -i {file} -r sc-ids@dotnetfoundation.org -s \"{signClientSecret}\" -n 'IdentityServer4'", noEcho: true); + Run("dotnet", $"SignClient sign -c ../../signClient.json -i {file} -r sc-ids@dotnetfoundation.org -s \"{signClientSecret}\" -n 'ForgePoint.Identity'", noEcho: true); } } }