works.iterative.server.http.impl.pac4j

Members list

Type members

Classlikes

trait HttpSecurity

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class OidcClientConfig(clientId: String, clientSecret: String, discoveryURI: String, audience: Option[String] = ...)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Pac4jAuthenticationAdapter extends AuthenticationService

Adapter that bridges Pac4J authentication to ZIO AuthenticationService.

Adapter that bridges Pac4J authentication to ZIO AuthenticationService.

This adapter:

  • Maps Pac4J CommonProfile (Java) to BasicProfile (Scala/ZIO)
  • Handles null values defensively with Option
  • Stores user context in FiberRef for request-scoped authentication
  • Extracts roles from Pac4J profile attributes

Example usage:

// After Pac4J successful authentication with CommonProfile
val profile: CommonProfile = ... // from Pac4J
val token = AccessToken("oauth-token-123")

for
 adapter <- ZIO.service[AuthenticationService]
 basicProfile = Pac4jAuthenticationAdapter.mapProfile(profile)
 _ <- adapter.loggedIn(token, basicProfile)
 currentUser <- adapter.currentUserInfo
yield currentUser // Some(AuthedUserInfo(...))

Attributes

Supertypes
trait AuthenticationService
class Object
trait Matchable
class Any
Self type
class Pac4jConfigFactory[F <: ([_] =>> AnyRef)](baseUri: BaseUri, pac4jConfig: Pac4jSecurityConfig, dispatcher: Dispatcher[F], authorizationGenerator: AuthorizationGenerator = ...)(implicit evidence$1: Sync[F]) extends ConfigFactory

Attributes

Companion
object
Supertypes
trait ConfigFactory
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class Pac4jHttpSecurity[F <: ([_] =>> AnyRef)](baseUri: BaseUri, config: Pac4jSecurityConfig, pac4jConfig: Config, dispatcher: Dispatcher[F])(implicit evidence$1: Sync[F]) extends HttpSecurity

Attributes

Supertypes
trait HttpSecurity
class Object
trait Matchable
class Any
trait Pac4jModuleRegistry[R, U] extends ModuleRegistry[R]

Attributes

Supertypes
trait ModuleRegistry[R]
class Object
trait Matchable
class Any
case class Pac4jSecurityConfig(urlBase: String, callbackBase: String, defaultUrl: Option[String], logoutUrl: Option[String], logoutUrlPattern: Option[String], sessionSecret: String, client: OidcClientConfig, clients: Map[String, OidcClientConfig])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type