简体   繁体   English

如何在 Foundry Code Workbook 中生成身份验证令牌以用作 API 的参数?

[英]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.

相关问题 如何在代码工作簿中合并 Palantir Foundry 中的两个数据集? - How do I union two datasets in Palantir Foundry within a code workbook? 如何在代码工作簿中加入 Palantir Foundry 中的两个数据集? - How do I JOIN two datasets in Palantir Foundry within a code workbook? 如何在 Foundry Code Workbook 的控制台中显示 matplotlib 图? - How do I display a matplotlib plot in the console in Foundry Code Workbook? 在 Foundry 代码存储库中,如何从 Python 转换中记录调试消息? - In a Foundry Code Repository, how do I log debug messages from within a Python transform? 如何在 Foundry 代码存储库中使用本地 IDE 进行 Java 转换? - How do I use a local IDE for Java Transforms in Foundry Code Repositories? 如何在 Palantir Foundry 的 Code Workbook 中使用 sparkcontext 创建一个空数据集? - How can I create an empty dataset using sparkcontext in Code Workbook in Palantir Foundry? 我可以在 Foundry 代码工作簿中保存 .png 吗? - Can I save a .png in a Foundry Code Workbook? 如何将数据集转换为 repo 中的字典。 我在铸造厂内使用 pyspark - How do I transform the data set into a dictionary inside the repo. I am using pyspark within foundry 如何从 Foundry 中的代码存储库编写或创建外部数据集 - How to write or create external dataset from code repository within Foundry 如何在我的 Foundry 代码库中强制执行最低测试覆盖率百分比? - How do I enforce a minimum test coverage percentage in my Foundry Code Repositories?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM