dragosgaftoneanu/okta-auth-code-flow

This package is abandoned and no longer maintained. The author suggests using the dragosgaftoneanu/okta-oidc-flows-php package instead.

Simple library to do authorization code flow and retrieve details also from /userinfo and /introspect.

1.1 2020-05-27 07:40 UTC

This package is auto-updated.

Last update: 2021-03-26 11:58:43 UTC


README

Okta Authorization Code Flow is a simple library to do authorization code flow and retrieve details also from /userinfo and /introspect.

⚠️ Disclaimer: This is not an official product and does not qualify for Okta Support.

Installation

You can install this library by running the following command through Composer

composer require dragosgaftoneanu/okta-auth-code-flow

Requirements

  • An Okta account, called an organization (you can sign up for a free developer organization)
  • A local web server that runs PHP 7.0+

Methods available

setClientId($client_id)

This method sets the client ID used for authorization code flow.

setClientSecret($client_secret)

This method sets the client secret used for authorization code flow.

setRedirectUri($redirect_uri)

This method sets the redirect uri used for authorization code flow.

setIssuer($issuer)

This method sets the issuer used for authorization code flow.

setScopes($scopes)

This method sets the scopes used for authorization code flow.

setState($state)

This method sets the state used for authorization code flow.

setNonce($nonce)

This method sets the nonce used for authorization code flow.

parseAuthCode($code, $state, $error, $full=true)

This method takes the authorization code, state, error parameters from either GET or POST in order to further process the flow. If $full is set to true, then the result will contain also the details from /introspect and /userinfo endpoint, otherwise it will return only the JWT tokens received after exchanging the code.

Bugs?

If you find a bug or encounter an issue when using the library, please open an issue on GitHub here and it will be further investigated.