[英]How do I generate authentication tokens within Foundry Code Workbook to use as an argument to APIs?
In a Foundry Code Workbook, I'm trying to make a call to an API where one of the arguments is an authentication token.在 Foundry Code Workbook 中,我试图调用一个 API,其中一个参数是身份验证令牌。
What is the best way to generate authentication tokens during execution?在执行期间生成身份验证令牌的最佳方法是什么? Can they be reused in multiple calls?
它们可以在多个调用中重复使用吗?
You can use the command below to get a token during the execute stage:您可以使用以下命令在执行阶段获取令牌:
token = spark.sparkContext.getLocalProperty('foundry.spark.session.bearerToken')
The token should be available for more than one call.令牌应可用于多个呼叫。 If you need different/new tokens you can call the Multipass API to generate a new one.
如果您需要不同的/新的令牌,您可以调用 Multipass API 来生成一个新的令牌。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.