asp.net mvc 4 - IdentityServer3 with ServiceStack and MVC Client -


i'm new identityserver3 , starting set up. seems going quite , i've been working on hybrid flow mvc app similar shown in kevin dockx's pluralsight course (http://www.pluralsight.com/courses/building-securing-restful-api-aspdotnet) when tried configure identityserver mvc error pops up- microsoft.identitymodel.protocols.openidconnectprotocolexception: invalid_request

id server:

new client {    enabled = true,    clientname = "mvc client (hybrid flow)",    clientid = "mvc",    flow = flows.hybrid,    requireconsent = true,    redirecturis = new list<string>    {"https://localhost:44358/"},                     }   var scopes = new list<scope>{                         standardscopes.openid,     standardscopes.profile  }; 

and following code mvc client app

public void configuration(iappbuilder app)     {                     app.usecookieauthentication(new cookieauthenticationoptions         {             authenticationtype = "cookies",             //cookiename = "ourcookiename"         });          var options = new openidconnectauthenticationoptions         {             clientid = "mvc",             authority = "https://localhost:44367/identity/",             redirecturi = "https://localhost:44358/",             // postlogoutredirecturi = "https://localhost:44300/",             signinasauthenticationtype = "cookies",             responsetype = "code id_token token",             scope = "openid profile"         };         app.useopenidconnectauthentication(options);              } 

and have configure identityserver3 servicestack' used linkhttps://github.com/macleanelectrical/servicestack-authentication-identityserver` authenticate service in global.aspx new apphost().init(); shows error-

'system.nullreferenceexception' occurred in servicestack.dll not handled in user code 

here how i'm doing mine

return new[]         {             new client             {                 enabled = true,                 clientid = "client",                 clientname = "someclient",                 flow = flows.hybrid,                 requireconsent = true,                 allowedscopes = new list<string>                 {                     "openid",                     "profile",                     "roles",                     "api",                     "offline_access"                 },                 redirecturis = new list<string>                 {                     constants.client                 },                  accesstokenlifetime = 3600,                  clientsecrets = new list<secret>()                 {                     new secret("secret".sha256())                 }             }         };   var scopes = new list<scope>         {              //identity scopes             standardscopes.openid,             standardscopes.profile,              new scope             {                 enabled = true,                 name = "roles",                 displayname = "roles",                 description = "the roles belong to.",                 type = scopetype.identity,                 claims = new list<scopeclaim>                 {                     new scopeclaim("role")                 }             },             new scope             {                 enabled = true,                 name="api",                 displayname = "api scope",                 description = "to accesss api",                 type = scopetype.resource,                 emphasize = false,                 claims = new list<scopeclaim>                 {                     new scopeclaim("role"),                     new scopeclaim("id")                 }              },              standardscopes.offlineaccess          };          return scopes; 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -