Zitadel PHP API

IDP
in package

Class for working with external Identity Providers.

Table of Contents

Properties

$authUrl  : string
$failureUrl  : string
$idpAccessToken  : string
$idpEmail  : string
$idpId  : string
$idpIntentId  : string
$idpPicture  : string
$idpProfile  : string
$idpRawInformation  : string
$idpToken  : string
$idpUserId  : string
$idpUserName  : string
$isIdpEmailVerified  : bool
$settings  : array<string|int, mixed>
$successUrl  : string
$userid  : int

Methods

__construct()  : mixed
Initialize the IDP setup
fetchIdpData()  : void
Fetch the data from the IDP.
getAccessToken()  : string
Get the OAuth-Access Token from the IDP
getAuthUrl()  : string
Get the Auth-URL to start the login flow with the external IDP
getIdpEmail()  : string
Get the Email address from the IDP
getIdpPicture()  : string
Get the profile picture from the IDP
getIdpProfile()  : string
Get the profile URL from the IDP
getIdpRawInformation()  : string
Get the raw user data from the IDP
getIdpUserId()  : string
Get the User-ID from the IDP
getIdpUserName()  : string
Get the Username from the IDP
isIdpEmailVerified()  : bool
Returns true, when the Email address from the IDP is verified.
linkIdpToUser()  : void
Link the IDP with a user account, so the user can sign in through the IDP
setFailureUrl()  : void
Set the failure URL. After the OAuth-Flow, the user will be redirected to it, if the login was successful.
setIdpId()  : void
Set the id of the Identity Provider.
setIdpIntentId()  : void
Set the IDP Intent ID
setIdpToken()  : void
Set the IDP Token
setIdpUserId()  : void
Set the User-ID for the IDP-Account
setSuccessUrl()  : void
Set the success URL. After the OAuth-Flow, the user will be redirected to it, if the login was successful.
setUserId()  : void
Set the userid
startFlow()  : void
Start the OAuth Flow. If the request is successful, the user will be redirected to the success URL with the GET Parameters id(IDP-Intent-ID) and token(IDP-Token)

Properties

$authUrl

private string $authUrl

$failureUrl

private string $failureUrl

$idpAccessToken

private string $idpAccessToken

$idpEmail

private string $idpEmail

$idpId

private string $idpId

$idpIntentId

private string $idpIntentId

$idpPicture

private string $idpPicture

$idpProfile

private string $idpProfile

$idpRawInformation

private string $idpRawInformation

$idpToken

private string $idpToken

$idpUserId

private string $idpUserId

$idpUserName

private string $idpUserName

$isIdpEmailVerified

private bool $isIdpEmailVerified

$settings

private array<string|int, mixed> $settings

$successUrl

private string $successUrl

$userid

private int $userid

Methods

__construct()

Initialize the IDP setup

public __construct(mixed $settings) : mixed
Parameters
$settings : mixed

array The settings array

fetchIdpData()

Fetch the data from the IDP.

public fetchIdpData() : void
Tags
throws
Exception

getAccessToken()

Get the OAuth-Access Token from the IDP

public getAccessToken() : string
Return values
string

OAuth-Access Token

getAuthUrl()

Get the Auth-URL to start the login flow with the external IDP

public getAuthUrl() : string
Return values
string

AuthURL.

getIdpEmail()

Get the Email address from the IDP

public getIdpEmail() : string
Return values
string

Email address

getIdpPicture()

Get the profile picture from the IDP

public getIdpPicture() : string
Return values
string

Profile picture URL

getIdpProfile()

Get the profile URL from the IDP

public getIdpProfile() : string
Return values
string

Profile URL

getIdpRawInformation()

Get the raw user data from the IDP

public getIdpRawInformation() : string
Return values
string

JSON string with the raw user data

getIdpUserId()

Get the User-ID from the IDP

public getIdpUserId() : string
Return values
string

User-ID

getIdpUserName()

Get the Username from the IDP

public getIdpUserName() : string
Return values
string

Username

isIdpEmailVerified()

Returns true, when the Email address from the IDP is verified.

public isIdpEmailVerified() : bool
Return values
bool

Is the Email address verified

linkIdpToUser()

Link the IDP with a user account, so the user can sign in through the IDP

public linkIdpToUser() : void
Tags
throws
Exception

setFailureUrl()

Set the failure URL. After the OAuth-Flow, the user will be redirected to it, if the login was successful.

public setFailureUrl(string $failureUrl) : void
Parameters
$failureUrl : string

Failure URL

setIdpId()

Set the id of the Identity Provider.

public setIdpId(string $idpId) : void
Parameters
$idpId : string

ID of the Identity Provider

setIdpIntentId()

Set the IDP Intent ID

public setIdpIntentId(string $idpIntentId) : void
Parameters
$idpIntentId : string

IDP Intent ID. Zitadel sends it in the GET-Parameter "id" to the success URL

setIdpToken()

Set the IDP Token

public setIdpToken(string $idpToken) : void
Parameters
$idpToken : string

IDP Token. Zitadel sends it in the GET-Parameter "token" to the success URL

setIdpUserId()

Set the User-ID for the IDP-Account

public setIdpUserId(string $idpUserId) : void
Parameters
$idpUserId : string

User-ID for the IDP-Account

setSuccessUrl()

Set the success URL. After the OAuth-Flow, the user will be redirected to it, if the login was successful.

public setSuccessUrl(string $successUrl) : void
Parameters
$successUrl : string

Success-URL

setUserId()

Set the userid

public setUserId(mixed $userid) : void
Parameters
$userid : mixed

int User id

startFlow()

Start the OAuth Flow. If the request is successful, the user will be redirected to the success URL with the GET Parameters id(IDP-Intent-ID) and token(IDP-Token)

public startFlow() : void
Tags
throws
Exception

        
On this page

Search results