Get value JWTDecode.Android

0

I have the following JWT token

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJDQVRBUFJFXHUwMGM3TyIsImF1ZCI6ImZyYW5xdWVhZG9zX3VzdWFyaW9zIiwic3ViIjoiMSIsImlhdCI6MTUxNjIxODAxNCwiZXhwIjoxNTIyMjE5ODE0LCJ1c2VyX2luZm8iOnsiaWQiOjEsImVtYWlsIjoidGVzdGVAdGVzdGUuY29tLmJyIiwiZnJhbnF1ZWFkb19pZCI6MSwiZXN0YWRvcyI6WzIwXX19.3Cr5wSQIjaXhud30k_Cr9KRsNNIQDdM6oP_tyFlQnpw

Decoding the site link I have the following result:

{
  "iss": "CATAPREÇO",
  "aud": "franqueados_usuarios",
  "sub": "1",
  "iat": 1516218014,
  "exp": 1522219814,
  "user_info": {
    "id": 1,
    "email": "[email protected]",
    "franqueado_id": 1,
    "estados": [
      20
    ]
  }
}

I'm using JWTDecode.Android

How do I get the value of "user_info"?

I'm trying like this:

JWT jwt = new JWT(token);
String userInfo = jwt.getClaim("user_info").AsString;

This returns null

I've tried it too:

JWT jwt = new JWT(token);
List<UserInfo> userInfos = jwt.getClaim("user_info").asList(UserInfo.class);

But I could not.

    
asked by anonymous 17.01.2018 / 21:58

0 answers