Identityserver4: Invalid scope when API resource constructor is not parameterized

Created on 25 Mar 2017  路  2Comments  路  Source: IdentityServer/IdentityServer4

I tried with two things . .....

One which works --
```
new ApiResource("mvc", "Storyboard Mvc App"){
UserClaims= { "name" , "email"},
ApiSecrets = { new Secret("secret".Sha256())},
},



But when I Do this -- 




 ```
               new ApiResource
                {
                    Name="mvc",
                    DisplayName="Storyboard Mvc App",
                    UserClaims = {"name","email"},
                    ApiSecrets = { new Secret("secret".Sha256())},
                },

It doesnt work at all. All it gives is invalid scope . WHY !! :(

capture

And here is my OpenId configuration for Mvc app --

image

question

Most helpful comment

The ctor is a convenience for setting name and scope in one go. If you don't use it you need to create the scope yourself.

All 2 comments

The ctor is a convenience for setting name and scope in one go. If you don't use it you need to create the scope yourself.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings