-
Notifications
You must be signed in to change notification settings - Fork 273
Cleanup UM sample #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Cleanup UM sample #366
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3d4196a
For UserManagement sample: Use .localhost TLDs for endpoints. Added l…
ProgrammerAL 77fe457
Cleaned up some UI elements and readme
ProgrammerAL 22bfec4
Deleted the UserManagementSample.GettingStarted project. It isn't bei…
ProgrammerAL e16b9dc
Also host identityserver UM project in localhost:5001 domain so the c…
ProgrammerAL a935857
Removed some commented out code
ProgrammerAL f27919e
Re-added the UM Getting Started sample. Moved all 2 UM samples into t…
ProgrammerAL 210c665
Updated the IS app in UserManagementSample to no longer use the ident…
ProgrammerAL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
IdentityServer/v8/UserManagement/FullSample/UserManagementSample.AppHost/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) Duende Software. All rights reserved. | ||
| // Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
|
||
| var builder = DistributedApplication.CreateBuilder(args); | ||
|
|
||
| var mailpit = builder.AddContainer("mailpit", "axllent/mailpit") | ||
| .WithContainerName($"user-management-sample-mailpit") | ||
| .WithHttpEndpoint(port: 8025, targetPort: 8025, name: "ui", isProxied: false) | ||
| .WithEndpoint(port: 1025, targetPort: 1025, name: "smtp", isProxied: false); | ||
| var smtpEndpoint = mailpit.GetEndpoint("smtp"); | ||
|
|
||
| var identityServer = builder.AddProject<Projects.UserManagementSample>("identity-server") | ||
| .WaitFor(mailpit) | ||
| .WithSmtp(smtpEndpoint); | ||
|
|
||
| builder.AddProject<Projects.UserManagementSample_Client>("client") | ||
| .WithReference(identityServer); | ||
|
|
||
| builder.AddProject<Projects.UserManagementSample_AspNetIdentitySource>("aspnet-identity-source"); | ||
|
|
||
| builder.Build().Run(); | ||
|
|
||
| internal static class AspireExtensions | ||
| { | ||
| /// <summary> | ||
| /// Injects SMTP configuration (Smtp:Host, Smtp:Port, Smtp:EnableSsl) from a mailpit endpoint. | ||
| /// </summary> | ||
| internal static IResourceBuilder<T> WithSmtp<T>(this IResourceBuilder<T> project, EndpointReference smtpEndpoint) | ||
| where T : IResourceWithEnvironment => | ||
| project | ||
| .WithEnvironment("Smtp__Host", smtpEndpoint.Property(EndpointProperty.Host)) | ||
| .WithEnvironment("Smtp__Port", smtpEndpoint.Property(EndpointProperty.Port)) | ||
| .WithEnvironment("Smtp__FromEmail", "no-reply@localhost") | ||
| .WithEnvironment("Smtp__FromName", "UserManagement Sample") | ||
| .WithEnvironment("Smtp__EnableSsl", "false"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
...ement/FullSample/UserManagementSample.AspNetIdentitySource/Properties/launchSettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/launchsettings.json", | ||
| "profiles": { | ||
| "https": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": true, | ||
| "applicationUrl": "https://aspnet-identity-source.dev.localhost:5003", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| } | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
IdentityServer/v8/UserManagement/FullSample/UserManagementSample/Pages/Account/Login.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| @page | ||
| @model UserManagementSample.Pages.Account.LoginModel | ||
|
|
||
| <div class="row"> | ||
| <h2>Sign In</h2> | ||
| <hr /> | ||
| <button id="passkey-btn" type="button" class="btn btn-success mb-2"> | ||
| Sign in with Passkey | ||
| </button> | ||
| <a asp-page="/Account/LoginWithOtp" asp-route-returnUrl="@Model.ReturnUrl" class="btn btn-primary mb-2"> | ||
| Sign in with OTP | ||
| </a> | ||
| <a asp-page="/Account/LoginWithPassword" asp-route-returnUrl="@Model.ReturnUrl" class="btn btn-secondary mb-2"> | ||
| Sign in with Password | ||
| </a> | ||
| @if (Model.GoogleConfigured) | ||
| { | ||
| <a href="/Account/ExternalLogin?provider=Google&returnUrl=@Uri.EscapeDataString(Model.ReturnUrl ?? string.Empty)" class="btn btn-danger mb-2"> | ||
| Sign in with Google | ||
| </a> | ||
| } | ||
| else | ||
| { | ||
|
|
||
| <div>google authentication is disabled. Configure the key Authentication:Google:ClientId in appsettings.json to enable it</div> | ||
| } | ||
| </div> | ||
|
|
||
| @section Scripts { | ||
| <script src="/passkeys/js"></script> | ||
| <script> | ||
| (function () { | ||
| const returnUrl = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(Model.ReturnUrl ?? "/")); | ||
|
|
||
| console.log(returnUrl); | ||
|
|
||
| document.getElementById('passkey-btn').addEventListener('click', async function () { | ||
| const btn = this; | ||
| btn.disabled = true; | ||
| try { | ||
| await authenticateWithDiscoverablePasskey(); | ||
| window.location.href = returnUrl; | ||
| } catch (err) { | ||
| alert(err?.message ?? 'Passkey authentication failed.'); | ||
| btn.disabled = false; | ||
| } | ||
| }); | ||
| })(); | ||
| </script> | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...tyServer/v8/UserManagement/FullSample/UserManagementSample/Properties/launchSettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/launchsettings.json", | ||
| "profiles": { | ||
| "https": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": true, | ||
| "applicationUrl": "https://identityserver.dev.localhost:5001;https://localhost:5001", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| } | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
IdentityServer/v8/UserManagement/GettingStarted/GettingStarted.slnx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Solution> | ||
| <Project Path="GettingStarted.csproj" /> | ||
| </Solution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.