Skip to content

Commit

Permalink
change AzureAd to EntraID
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Oct 10, 2023
1 parent 55400b0 commit b5c1726
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Register an App in **[Microsoft Entra ID (Azure Active Directory)]((https://azur
- Set an **Application ID URI** as unique for this app
- Expose an API with name `access_as_user` and with **Admins and users** type
- Change `accessTokenAcceptedVersion` to `2` in Manifest blade
- Copy "**appId**" to set as **AzureAd:ClientId** in **appsettings.json** file
- Copy "**appId**" to set as **EntraID:ClientId** in **appsettings.json** file

```json
"AzureAd": {
"EntraID": {
"Domain": "{YOUR-VALUE}",
"TenantId": "{YOUR-VALUE}",
"ClientId": "{YOUR-VALUE}",
Expand Down
2 changes: 1 addition & 1 deletion src/API/Elf.Api/Auth/ElfAuthSchemas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ public static class ElfAuthSchemas
{
public const string All = "Bearer,APIKey";
public const string Api = ApiKeyAuthenticationOptions.DefaultScheme;
public const string AzureAD = JwtBearerDefaults.AuthenticationScheme;
public const string EntraID = JwtBearerDefaults.AuthenticationScheme;
}
8 changes: 4 additions & 4 deletions src/API/Elf.Api/Elf.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>Edi Wang</Authors>
<Company>edi.wang</Company>
<Copyright>(C) 2023 edi.wang@outlook.com</Copyright>
<AssemblyVersion>6.5.15</AssemblyVersion>
<FileVersion>6.5.15</FileVersion>
<Version>6.5.15</Version>
<AssemblyVersion>6.6.0</AssemblyVersion>
<FileVersion>6.6.0</FileVersion>
<Version>6.6.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/API/Elf.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void ConfigureServices(IServiceCollection services)
services.AddSingleton<CannonService>();
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddApiKeySupport(_ => { })
.AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd"));
.AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("EntraID"));

services.AddAuthorization();

Expand Down
2 changes: 1 addition & 1 deletion src/API/Elf.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"AllowSelfRedirection": false,
"EnableTracking": true
},
"AzureAd": {
"EntraID": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "qualified.domain.name",
"TenantId": "00000000-0000-0000-0000-000000000000",
Expand Down

0 comments on commit b5c1726

Please sign in to comment.