All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.connect.amazon.iamidentitycenter.HttpSSO.kt Maven / Gradle / Ivy

The newest version!
package org.http4k.connect.amazon.iamidentitycenter

import org.http4k.client.JavaHttpClient
import org.http4k.connect.amazon.core.model.Region
import org.http4k.core.HttpHandler
import org.http4k.core.Uri
import org.http4k.core.then
import org.http4k.filter.ClientFilters

/**
 * Standard HTTP implementation of SSO
 */
fun SSO.Companion.Http(
    region: Region,
    http: HttpHandler = JavaHttpClient(),
) = object : SSO {

    private val routedHttp = ClientFilters.SetHostFrom(Uri.of("https://portal.sso.$region.amazonaws.com"))
        .then(ClientFilters.SetXForwardedHost())
        .then(http)

    override fun  invoke(action: SSOAction) = action.toResult(routedHttp(action.toRequest()))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy