在Java中使用令牌依次调用多个API [英] Calling multiple API in sequence with token in java
问题描述
生成令牌后,我必须依次调用5 APIs
.我正在使用API
下面的内容来生成token
.
I have to call 5 APIs
in sequence after generating the token. i am using below API
to generate token
.
POST https://idcs-xxxx.identity.c9dev2.oc9qadev.com/oauth2/v1/token
我将发送username
和password
以获得上述API中的令牌.一旦收到令牌,我将不得不使用same token
依次调用低于5 APIs
的代码.
我将使用一个API
中的output
并将其过滤并选择一些值作为下一个API
的输入.所有rest endpoint
都会根据前一个API
response
的input
值进行更改.
I will send username
and password
to get token in above API. Once token will be received I will have to use the same token
to call below 5 APIs
in sequence.
I will use output
of one API
and filter it and pick some values as an input to next API
. all the rest endpoint
will change based on the input
value of previous API
response
.
GET https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/skills
GET https://idcs-oda-9417f93560b94eb8a2e2a4c9aac9a3ff-t0.data.digitalassistant.oci.oc-test.com/api/v1/skills/dynamicEntities
POST https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/bots/xxx/v2/yyy
PATCH https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/bots/xxx
PUT https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/bots/xxx/DONE
我如何automate token generation
,并且每个API call
中都可以使用相同的token
. token
将每隔一小时过期一次.我唯一的目的是以某种方式使上述过程自动化.
即使是最小的帮助也将受到高度赞赏.您甚至可以提出解决方案的一部分,即使不是全部.我无法从Google那里获得很多资料.
How can I automate token generation
and the same token
can be used in every API call
. token
will expire in every one hour. My only purpose is to automate above process somehow.
even smallest help would be highly appreciated. you can suggest even some part of solution if not all. I could not get much material from google.
我对架构感兴趣,而不是编码.
Rather than coding I am interested in architecture.
推荐答案
Spring Security将在这里为您提供帮助.
Spring Security will help you here.
这篇关于在Java中使用令牌依次调用多个API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!