Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

535
Vistas
how to protect an API in fastapi using SAML SSO

I am writing a fastapi web app which gets authenticated using OKTA iDP with SAML 2.0 SSO. I want to protect my APIs in web app. I know fastapi has only Oauth2/token based API protection instead of cookie or session based. However, we receive only session info(session index) from IDP after successful authentication. How can I protect api in my web app by using this session index info? Is there any way to convert received session into token and save this in fastapi app to use for protection? Or please suggest me other way?

from fastapi import FastAPI

app = FastAPI()


@app.login("/sso/login")
async def login():
    # got sessionindex from Okta IDP
    return session

@app.logout("/sso/logout")
async def logout():
    # delete session received from Okta IDP on logout
    return
    
@app.get_graph()               <----------------------
async def get_graph():
    # how can i protect this api. so that i can access only
    # on successful authentication?
    return
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda