Claims of type array for JWT Module

0
I am trying to use the JWT-Module for creating a JSON web token. The token is needed for requiring an access token in MindSphere (Siemens).   This is an example for the needed payload: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ {   "iss": "d9341cbff41144abaf690b22e16b87d2",   "sub": "d9341cbff41144abaf690b22e16b87d2",   "aud": [     "southgate"   ],   "iat": 1532690970,   "nbf": 1532690970,   "exp": 1533295770,   "jti": "ed35d144e2742f93",   "schemas": [     "urn:siemens:mindsphere:v1"   ],   "ten": "connint1" } +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ I could easily create a JWT object with this claims, but without the array types. Instead of the array types I just used string types (there is only one string in the array). When I use the generated token I get a response 400 with error “invalid_grant”.   I am not sure about this, but the missing arrays could be the reason?   I also tried to use Modul “JSON Web Tokens”. At the beginning it looked very promising, because the type array for claims is existing. But then I have run into big problems because of the used package “sun.misc” (I am using Mendix Studio Pro 8).   Is there a chance to create claims of type array in the JWT-Module?
asked
2 answers
1

Hi Philipp,

Do you know the "Build a MindSphere app with Mendix" in the mendix academy


https://gettingstarted.mendixcloud.com/link/path/80/Build-a-MindSphere-app-with-Mendix 

There you get everything you need to start creating apps with Mendix for Mindsphere. 
No need to handle all the JWT stuff by your own.

regards
Heiko

answered
0

Hi Philipp,

have a look here:

https://developer.mindsphere.io/howto/howto-selfhosted-api-access.html

If I understand you correctly you need “ApplicationCredentials” to access MindSphere APIs from an application running outside of MindSphere.

answered