Mark Oliver's World

Upgrading From IdentityServer Version 2 To IdentityServer Version 4


I have recently needed to upgrade from IdentityServer v2 to IdentityServer v4.

This was relatively painless (upgrade via nuget), but I had these 3 issues:

1 - PublicOrigin is no longer exposed, need to add it manually:

    //Add in PublicOrigin as it has been removed in v4 of IdentityServer:
    app.Use(async (ctx, next) =>
        await next();

2 - Add in ApiScopes :


Everything worked, except my Postman tests. Weird!

All my C# code was fine, which confused me.

After a lot of searching, I came across this page (English version) by Gabriel Bareclos.

It said:

I changed the content-type of the request from: form-data to: x-www-form-urlencoded .

So in my postman, I changed:

                    "mode": "formdata",
                    "formdata": [

to this:

                    "mode": "urlencoded",
                    "urlencoded": [

That was it. That fixed my postman tests!

Note - I should have looked at the docs again, although it is something that might pass you by:

POST /connect/token
CONTENT-TYPE application/x-www-form-urlencoded


Thank you for your time.

If you want to reach out, catch me on Twitter!