Skip to content

Instantly share code, notes, and snippets.

@alexlvovich
Last active November 4, 2019 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexlvovich/97ab02e79eceb02009d97dfed0d01903 to your computer and use it in GitHub Desktop.
Save alexlvovich/97ab02e79eceb02009d97dfed0d01903 to your computer and use it in GitHub Desktop.
DECLARE @ApiResourceId INT;
DECLARE @ClientId INT = 6; -- here is your client api which will use local api
-- add api resource for your local api
INSERT [dbo].[ApiResources] ([Enabled], [Name], [DisplayName], [Created], [NonEditable])
VALUES (1, 'apiAuth', 'Auth API', GETDATE(), 0)
SET @ApiResourceId = SCOPE_IDENTITY()
-- insert api scope
INSERT [dbo].[ApiScopes] ([Name], [DisplayName], [Description], [Required], [Emphasize], [ShowInDiscoveryDocument], [ApiResourceId])
VALUES ('IdentityServerApi', 'Auth API', null, 0, 0, 1, @ApiResourceId)
-- insert client
INSERT [dbo].[ClientScopes] ([Scope], [ClientId])
VALUES ('IdentityServerApi', @ClientId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment