Skip to content

Commit

Permalink
BFF now requests offline_access, useEndpoints removed (#202)
Browse files Browse the repository at this point in the history
* Request offline_access

* Remove limited access token lifetime

---------

Co-authored-by: Roland Guijt <roland.guijt@gmail.com>
  • Loading branch information
RolandGuijt and Roland Guijt authored Jul 15, 2024
1 parent f0f75ac commit 5e7a20b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public static class Config

// where to redirect to after logout
PostLogoutRedirectUris = { "https://localhost:5003/signout-callback-oidc" },
AllowOfflineAccess = true,

AllowedScopes = new List<string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
options.ClientSecret = "secret";
options.ResponseType = "code";
options.Scope.Add("api1");
options.Scope.Add("offline_access");
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
});
Expand All @@ -47,20 +48,17 @@

app.UseAuthorization();

app.UseEndpoints(endpoints =>
{
endpoints.MapBffManagementEndpoints();
app.MapBffManagementEndpoints();

// Uncomment this for Controller support
// endpoints.MapControllers()
// .AsBffApiEndpoint();
// Uncomment this for Controller support
// app.MapControllers()
// .AsBffApiEndpoint();

endpoints.MapGet("/local/identity", LocalIdentityHandler)
.AsBffApiEndpoint();
app.MapGet("/local/identity", LocalIdentityHandler)
.AsBffApiEndpoint();

endpoints.MapRemoteBffApiEndpoint("/remote", "https://localhost:6001")
.RequireAccessToken(Duende.Bff.TokenType.User);
});
app.MapRemoteBffApiEndpoint("/remote", "https://localhost:6001")
.RequireAccessToken(Duende.Bff.TokenType.User);

app.Run();

Expand Down

0 comments on commit 5e7a20b

Please sign in to comment.