Skip to content

Instantly share code, notes, and snippets.

Last active Nov 4, 2019
What would you like to do?
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)
-- 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