-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added the possibility to register custom authorization policies * removed commented code * introduced ApiGroup Constants * added examples in code comment for Policy options * updated notes.txt Co-authored-by: Thomas Duft <[email protected]>
- Loading branch information
1 parent
7d7df60
commit 1a0e720
Showing
16 changed files
with
198 additions
and
124 deletions.
There are no files selected for viewing
This file contains 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 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 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
12 changes: 12 additions & 0 deletions
12
src/identity/OpenIddict.UI.Identity.Api/Common/Constants.cs
This file contains 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,12 @@ | ||
namespace tomware.OpenIddict.UI.Identity.Api | ||
{ | ||
public static class Policies | ||
{ | ||
public const string OPENIDDICT_UI_IDENTITY_API_POLICY = "OpenIddictUiIdentityApiPolicy"; | ||
} | ||
|
||
public static class ApiGroups | ||
{ | ||
public const string OPENIDDICT_UI_IDENTITY_GROUP = "openiddict-ui-identity"; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/identity/OpenIddict.UI.Identity.Api/Common/IdentityApiController.cs
This file contains 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,16 @@ | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using OpenIddict.Validation.AspNetCore; | ||
using tomware.OpenIddict.UI.Suite.Api; | ||
|
||
namespace tomware.OpenIddict.UI.Identity.Api | ||
{ | ||
[ApiExplorerSettings(GroupName = ApiGroups.OPENIDDICT_UI_IDENTITY_GROUP)] | ||
[Authorize( | ||
Policies.OPENIDDICT_UI_IDENTITY_API_POLICY, | ||
AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme | ||
)] | ||
public class IdentityApiController : ApiControllerBase | ||
{ | ||
} | ||
} |
This file contains 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 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 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 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 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,12 @@ | ||
namespace tomware.OpenIddict.UI.Api | ||
{ | ||
public static class Policies | ||
{ | ||
public const string OPENIDDICT_UI_API_POLICY = "OpenIddictUiApiPolicy"; | ||
} | ||
|
||
public static class ApiGroups | ||
{ | ||
public const string OPENIDDICT_UI_GROUP = "openiddict-ui-api"; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/openiddict/OpenIddict.UI.Api/Common/OpenIddictApiController.cs
This file contains 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,16 @@ | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using OpenIddict.Validation.AspNetCore; | ||
using tomware.OpenIddict.UI.Suite.Api; | ||
|
||
namespace tomware.OpenIddict.UI.Api | ||
{ | ||
[ApiExplorerSettings(GroupName = ApiGroups.OPENIDDICT_UI_GROUP)] | ||
[Authorize( | ||
Policies.OPENIDDICT_UI_API_POLICY, | ||
AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme | ||
)] | ||
public class OpenIddictApiController : ApiControllerBase | ||
{ | ||
} | ||
} |
Oops, something went wrong.