curl - Thinktecture IdentityModel getting session token -
the way session token using thinktecture identitymodel http://www.website.com/api/token. getting , error "response status code not indicate success: 404 (not found)." when using browser following code.
var credentials = new networkcredential("admin", "password"); var handler = new httpclienthandler { credentials = credentials }; var client = new httpclient(handler) {baseaddress = new uri("http://www.website.com/")}; var response = await client.getasync("api/token"); response.ensuresuccessstatuscode(); // throw on error code. var accountinformationjson = await response.content.readasstringasync();
however when try using curl curl --user admin:password --get http://www.website.com/api/token
i seem getting session json fine { "access_token": "hfsdhfhfjhdfhds8f9jsdhr9843hrf.shf789qy34rjhf9awyfw8ehf.....", "expires_in": 36000.0 }
any ideas why happen?
i had call http://www.website.com/api/controller/token session token.
Comments
Post a Comment