最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

openid connect - How to authenticate with OCI using OIDC in serverless environments (AWS LambdaAzure Functions) with Python SDK

programmeradmin8浏览0评论

How to authenticate with OCI using OIDC in serverless environments (AWS Lambda/Azure Functions) with Python SDK?

Background

I'm trying to implement a solution where code running in serverless environments (AWS Lambda or Azure Functions) needs to access Oracle Cloud Infrastructure (OCI) resources using the Python SDK. I need to use OpenID Connect (OIDC) to obtain temporary credentials for authenticating with OCI.

Problem

While I understand how to implement OIDC-based authentication with AWS (using OIDC to get an ID token, then exchanging it for AWS STS credentials), I'm struggling to find equivalent documentation or methods for OCI when using the Python SDK specifically.

What I've done so far:

  1. Successfully added a custom OIDC Identity Provider in the OCI Identity domain following the Add a social identity provider documentation
    Image of my OIDC Idp
  2. Reviewed OCI documentation on Session Token-Based Authentication
  3. Looked into Python SDK documentation for authentication methods

Specific challenges:

  • The OCI documentation for Python SDK authentication with session tokens redirects to CLI-based authentication
  • I cannot use CLI-based authentication methods since I'm operating in serverless environments (AWS Lambda/Azure Functions)
  • I need to understand how to establish a connection between OIDC tokens and OCI session tokens programmatically in Python
  • I specifically need a solution that works with the OCI Python SDK

Questions:

  1. Is there a way to exchange OIDC tokens for OCI session tokens similar to how AWS STS works using the Python SDK?
  2. How can I authenticate with OCI Python SDK in a serverless environment without relying on CLI?
  3. Are there any code examples showing how to use OIDC tokens to authenticate with OCI Python SDK?

Technical environment:

  • Serverless platforms: AWS Lambda and Azure Functions
  • SDK: OCI Python SDK
  • Authentication method needed: OIDC-based (without CLI dependency)

Any guidance, documentation references, or code examples for implementing this with the Python SDK would be greatly appreciated!

发布评论

评论列表(0)

  1. 暂无评论