A
A
Andrey Romanyuk2018-09-03 13:07:44
API
Andrey Romanyuk, 2018-09-03 13:07:44

How can I send a claim object using Postman?

For example, this.User.GetUserId() is called in the api method . The GetUserId()
method itself:

public static Int64 GetUserId (this ClaimsPrincipal user) {
            return Int64.Parse (user.Claims.First (u => u.Type == "id").Value);
        }

It does not pass through Body if you specify a key-value in different sections. Through JSON too:
{
  "User":[
    {
      "id":"21",
    }
    ]	
}

{
   "id":"21",	
}

Maybe someone faced this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rayvor, 2018-09-03
@BLek2

First you get an access_token (usually a method called Token or GetToken), then you call GetUserId passing the token in the json body

{
   "access_token": "ТОКЕН"	
}

It also passes the type of token, lifetime, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question