Federated Login for httpMethod == "POST" fails
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- swift
- Área
- authentication
Línea de trabajo
Comienza en Sources/XcodesLoginKit/AppleSessionService.swift, en las líneas 198-223, y sigue cómo se gestionan httpMethod, idpURL y la apertura del navegador. Compara el flujo GET existente con los requisitos POST descritos para SAMLRequest y determina una implementación que admita la solicitud del proveedor sin un workaround específico del proveedor ni una solicitud de navegador malformada. Se considera terminado cuando el inicio de sesión federado mediante POST funciona correctamente y el comportamiento existente del inicio de sesión mediante GET permanece intacto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
My org implements Federated login via Microsoft Entra which expects a SAMLRequest parameter in addition to a few others to be submitted to the idPUrl via a POST request.
The current implementation in https://github.com/XcodesOrg/XcodesLoginKit/blob/main/Sources/XcodesLoginKit/AppleSessionService.swift#L198-L223 will always build a GET style URL and open it in the browser which then results in a malformed request warning from MS Entra.
I have tested two solutions for the issue locally that both work but i am unhappy with both for different reasons. -> Opening this issue hoping someone has a even better idea.
Solution 1:
Host a local Web Server within XcodesLoginKit that serves a self submitting POST form and open that URL in the browser instead if httpMethod == "POST".
Works by letting us send the actual request POST from a users browser, rest of the flow proceeds as before.
->
Requires either a http server dependency or some manual TCP socket magic. Doable but increases the project scope by a lot in my eyes.
Solution 2:
Check for SAMLRequest parameter + httpMethod == "POST" in idpURL getter implementation and rewrite to GET based request.
Works because the Entra endpoint also accepts GET based SAMLRequests but has the caveat of having to base64decode -> deflate -> base64encode -> urlencode the SAMLRequest parameter into the required format for GET based requests.
->
Requires a code path that is specific to a single Federation provider, also might break other implementations if not guarded for correctly. Feels More hacky to me.
Both of these approaches do work but i am not really happy with the tradeoffs for either. Hoping someone else has a better idea 😅
If not i am also happy to upstream either solution.
- Lenguaje dominante
- Swift
- Estrellas
- 15
- Forks
- 2
- Merge medio
- 7 h 14 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
steipete/CodexBar#4009 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
auth: ServiceAccountCredentials silently ignores quota_project_id in service account JSON files Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
googleapis/google-cloud-swift#1194 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
product / auth product / databases product / sites product / vcs
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Test: "nextTrack returns stream handoff for mixed playlist" depends on the saved Repeat setting Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100