Skip to content

Commit

Permalink
Added back resources because IdentityServer4 docs lie
Browse files Browse the repository at this point in the history
  • Loading branch information
i8beef committed Sep 25, 2020
1 parent d5cf2a9 commit f033ee2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/HomeAutio.Mqtt.GoogleHome/Identity/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ public static IEnumerable<IdentityResource> GetIdentityResources()
};
}

/// <summary>
/// Gets static list of api resources based on configuration.
/// </summary>
/// <returns>A list of <see cref="ApiResource"/>.</returns>
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new ApiResource("api", "HomeAutio.Mqtt.GoogleHome")
{
Scopes = new List<string> { "api" }
}
};
}

/// <summary>
/// Gets static list of api scopes.
/// </summary>
Expand All @@ -30,7 +45,7 @@ public static IEnumerable<ApiScope> GetApiScopes()
{
return new List<ApiScope>
{
new ApiScope(name: "api", displayName: "API")
new ApiScope("api")
};
}
}
Expand Down
1 change: 1 addition & 0 deletions src/HomeAutio.Mqtt.GoogleHome/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public void ConfigureServices(IServiceCollection services)
.AddInMemoryClients(Clients.Get(Configuration))
.AddInMemoryIdentityResources(Resources.GetIdentityResources())
.AddInMemoryApiScopes(Resources.GetApiScopes())
.AddInMemoryApiResources(Resources.GetApiResources())
.AddTestUsers(Users.Get(Configuration));

// Get signing certificates
Expand Down

0 comments on commit f033ee2

Please sign in to comment.