Skip to content

Authorize OIDC

Redirect the user to the OIDC authorization endpoint.

Request

Use the ThingsTelemetry\Traccar\Facades\Oidc::authorize() method.

php
use ThingsTelemetry\Traccar\Facades\Oidc;

$location = Oidc::authorize(
    clientId: 'client-id',
    redirectUri: 'https://your-app.com/callback',
    state: 'state-123',
    scope: 'openid profile email'
);

// Redirect the user to $location

Parameters

ParameterTypeDescription
clientIdstringThe client identifier.
redirectUristringThe redirect URI.
statestring?An opaque value used by the client to maintain state between the request and callback.
scopestring?A space-separated list of scopes.
responseTypestring?The response type (e.g., code).
codeChallengestring?PKCE code challenge.
codeChallengeMethodstring?PKCE code challenge method (e.g., S256).
noncestring?String value used to associate a Client session with an ID Token.

Result

Returns a string containing the redirect URL.

Released under the MIT License.