How to store token in variable

0
I have to login by username and password after login the token is generated. My doubt is that how i can i store the token into variable so i can access into GET API. grdata?token=(variable where token is stored) how can i achieve that. So if anyuser login the token will atomatically generates and store in variable so can be use anywhere.  
asked
2 answers
0

Hi Niharika,

 

You can simply store it in an attribute, maybe on you user/account entity, or on a separate entity with a association to the user, everytime the token renews you can change this attribute. If the token is sensitive information make sure that you put right security access rules and maybe think about encrypting the token.

 

Hope this helps

 

Good luck!

answered
0

Hello Niharika,

 

Step by step:

1. create a json structure with your json message i think your json message is this:

 

{ "token": "yourtokenvalue"}

image.png

 

2. create an import mapping based on your structure

 

image.png

 

3. map the attribute automatically 

image.png

4. the microflow will look a bit like this

image.png

In there the GET request is to get your token and looks like this:

 

image.png

 

your import mapping action like this:

 

image.png

 

And you account needs to have an attribute token to change 

image.png

 

now for every get request you need the token you can retrieve your account and put the token in there it will look a bit like this:

 

image.png

your new request should look a bit like this:

image.png

 

Hope this helps 

 

Good luck

 

 

answered