asp.net - System.ArgumentNullException when using TextEncodings -
i have following lines somewhere in code
var issuer = "https://" + configurationmanager.appsettings["auth0:domain"] + "/"; var audience = configurationmanager.appsettings["auth0:client_id"]; var secret = textencodings.base64url.decode( configurationmanager.appsettings["auth0:client_secret"]); an null exception thrown in last statement. here part of stack trace:
[argumentnullexception: value cannot null. parameter name: text] microsoft.owin.security.datahandler.encoder.base64urltextencoder.decode(string text) +99 authzero.api.startup.configureauthzero(iappbuilder app) in c:\users\abdi\source\repos\auth0-example\authzero.api\startup.cs:34 authzero.api.startup.configuration(iappbuilder app) in c:\users\abdi\source\repos\auth0-example\authzero.api\startup.cs:21 obviously textencodings.base64url.decode looking string parameter, instead have method inside. not sure why isn't working copying github repo.
here appsettings located web.config file:
<appsettings> <add key="auth0:clientid" value="go0k9jkaxegrgrshczluaiacr3asndkh" /> <add key="auth0:clientsecret" value="1zvvkpywgmfdufnldpb2a9xgukv_ycak-pxtna9rnvtjtihc5a8gvl6pcufm4owv" /> <add key="auth0:domain" value="amalexp.auth0.com" /> </appsettings> okay, think fixed issue removing configurationmanager.appsettings , inserting strings directly instead of looking @ app.config file. got "http error 403.14 - forbidden web server configured not list contents of directory." error story.
you have space , underscore in setting name in code, not in app.config.
Comments
Post a Comment