Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code updates for sample projects in description #197

Merged
merged 28 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4fe6b93
Configuration, diagnostics, DPOP
Jul 1, 2024
374efa7
Code update for MTLS, PAT, ScopesAndResources, SessionManagement, Tok…
Jul 3, 2024
b0144b4
Modernize code for AspNetIdentity and all BFF examples (#194)
RolandGuijt Jul 3, 2024
de81b4c
Output accesstoken instead of JSON (#199)
RolandGuijt Jul 3, 2024
f0f75ac
Updates for UserInteraction (#198)
RolandGuijt Jul 3, 2024
4d209c6
Update Angular CLI
Jul 12, 2024
5529c63
Update to Angular CLI v. 17
Jul 12, 2024
ced38b5
Update to Angular v17 2
Jul 12, 2024
562431e
Update to Angular 18
Jul 12, 2024
5e7a20b
BFF now requests offline_access, useEndpoints removed (#202)
RolandGuijt Jul 15, 2024
5338a4a
Use DI for HttpClient
Jul 22, 2024
73db265
Remove offline_access
Jul 22, 2024
b585435
Remove parenthesis
Jul 22, 2024
18ffbcb
New qs: Token Management
Jul 23, 2024
cdea15b
Add commented out code for "manual" mode
Jul 23, 2024
8939ce2
Better name for token object
Jul 23, 2024
6c718b9
Merge pull request #204 from DuendeSoftware/roland/qstokenmagement
leastprivilege Jul 23, 2024
9b7fdf7
Merge pull request #201 from DuendeSoftware/roland/bffangularupdate
josephdecock Aug 13, 2024
e612756
tweaks to quickstart 1
adamralph Sep 19, 2024
08bbf24
Update to IdentityServer 7.0.7
josephdecock Sep 20, 2024
eb8d36a
Update Aspire to latest version
Sep 21, 2024
fced0f2
Merge pull request #212 from adamralph/patch-1
leastprivilege Sep 22, 2024
980d6cd
Update OpenTelemetry.Instrumentation.GrpcNetClient
Sep 22, 2024
a97c84b
Merge pull request #213 from DuendeSoftware/roland/updateaspire
josephdecock Sep 22, 2024
a8d1fd9
Configuration, diagnostics, DPOP
Jul 1, 2024
c330e18
Code update for MTLS, PAT, ScopesAndResources, SessionManagement, Tok…
Jul 3, 2024
7095417
Update to IdentityServer 7.0.7
josephdecock Sep 20, 2024
a8fe71c
Merge branch 'roland/startupcsupdate' of https://github.com/DuendeSof…
Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 4 additions & 19 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,21 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup net8
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Setup net6
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Setup net5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'

- name: Setup net3
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- run: dotnet --info

- name: Install .NET Aspire workload
run: dotnet workload install aspire

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -75,4 +60,4 @@ jobs:
- run: ./build.sh build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
return;
}

Console.WriteLine(tokenResponse.Json);
Console.WriteLine(tokenResponse.AccessToken);
Console.WriteLine("\n\n");

// call api
Expand Down
1 change: 1 addition & 0 deletions IdentityServer/v7/AspNetIdentity/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
63 changes: 40 additions & 23 deletions IdentityServer/v7/AspNetIdentity/Client/Program.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Client
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRazorPages();

builder.Services.AddAuthentication(options =>
{
public class Program
options.DefaultScheme = "cookies";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("cookies")
.AddOpenIdConnect("oidc", options =>
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
options.Authority = "https://localhost:5001";
options.ClientId = "client";
options.MapInboundClaims = false;
options.SaveTokens = true;
options.DisableTelemetry = true;
});

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();

app.MapRazorPages();

app.Run();
71 changes: 0 additions & 71 deletions IdentityServer/v7/AspNetIdentity/Client/Startup.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace IdentityServerAspNetIdentity.Data
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>aspnet-WebApplication1-28A0C71B-1513-41CA-97E3-79006F6EEC18</UserSecretsId>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,65 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IdentityServerAspNetIdentity
{
public class Program
{
public static void Main(string[] args)
using Duende.IdentityServer.Models;
using IdentityServerAspNetIdentity.Data;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(
builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>();
builder.Services.AddRazorPages();

builder.Services.AddIdentityServer()
.AddInMemoryClients([
new Client
{
CreateHostBuilder(args).Build().Run();
ClientId = "client",
AllowedGrantTypes = GrantTypes.Implicit,
RedirectUris = { "https://localhost:5002/signin-oidc" },
PostLogoutRedirectUris = { "https://localhost:5002/signout-callback-oidc" },
FrontChannelLogoutUri = "https://localhost:5002/signout-oidc",
AllowedScopes = { "openid", "profile", "email", "phone" }
}
])
.AddInMemoryIdentityResources([
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
new IdentityResources.Email(),
new IdentityResources.Phone(),
])
.AddAspNetIdentity<IdentityUser>();

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
builder.Services.AddLogging(options =>
{
options.AddFilter("Duende", LogLevel.Debug);
});

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseIdentityServer();
app.UseAuthorization();

app.MapRazorPages();

app.Run();

This file was deleted.

Loading
Loading