User

class User

Representation of logged-in user.

Constructors

Link copied to clipboard
constructor(client: Client, session: UserSession)

Properties

Link copied to clipboard

ID Token

Link copied to clipboard
Link copied to clipboard

User integer id (as string)

Link copied to clipboard

User UUID

Functions

Link copied to clipboard

Generate URL for Schibsted account pages.

Link copied to clipboard
fun bind(builder: OkHttpClient.Builder): OkHttpClient.Builder

Bind this user to an OkHttpClient to automatically inject the user tokens for authorization.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Fetch user profile data.

Link copied to clipboard

Check if this User is logged-in.

Link copied to clipboard
fun logout()

Log user out.

Link copied to clipboard
fun makeAuthenticatedRequest(request: Request, callback: (Either<Throwable, Response>) -> Unit)

Perform the given request with user access token as Bearer token in Authorization header.

Link copied to clipboard
fun oneTimeCode(clientId: String, callback: (ApiResult<String>) -> Unit)

Requests a OAuth authorization code for the current user.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun webSessionUrl(clientId: String, redirectUri: String, state: String? = null, callback: (ApiResult<URL>) -> Unit)

Generate URL with embedded one-time code for creating a web session for the current user.