Download the PHP package pubpackage/okta-sdk-php without Composer

On this page you can find all versions of the php package pubpackage/okta-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package okta-sdk-php

Okta PHP SDK

Build Status Codecov License Support

Installation

okta-sdk-php is available on Packagist as the okta/sdk package.

Run composer require okta/sdk from the root of your project in terminal, and you are done.

Client Initialization

Once you have the SDK installed in your project, you will need to instantiate a Client object. We follow the builder pattern for building a Client. You can create a Client by calling the ClientBuilder and relying on the ~/.okta/okta .yaml file for the settings

By default, The client builder will look for a file in your home directory with the Okta properties you want to use. This file should be placed at ~/.okta/okta.yaml. If at this location, you do not need to define the location during initialization. If you are unable to place the file there, or you are on a Windows based machine, you will have to define the location of this file manually if you want to use the file.

If you need to override any of the defaults from your ~/.okta/okta.yaml file, or you do not have one, you can set the properties on the client builder directly. The minimum required properties are your token and organization url.

Changing your Http Client Instance

The Okta PHP SDK follows PSR-7 standards for HTTP Messages. We are using Httplug which allows you to change out to any PSR-7 compliant Http Client. Create a new instance of a Http\Client\HttpClient implementation and pass it into the client builder.

OAuth 2.0

Okta allows you to interact with Okta APIs using scoped OAuth 2.0 access tokens. Each access token enables the bearer to perform specific actions on specific Okta endpoints, with that ability controlled by which scopes the access token contains.

This SDK supports this feature only for service-to-service applications. Check out our guides to learn more about how to register a new service application using a private and public key pair.

When using this approach you won't need an API Token because the SDK will request an access token for you. In order to use OAuth 2.0, construct a client instance by passing the following parameters:

Users

Finding a user by id

Finding a user by email

Creating a User

Update user profile

Our SDK allows you to fill in the default profile fields, as well as other dynamic fields that you create in your profile.

Pagination and Collections

All of our calls that return a set of items will return a Collection object. The collection object we built on top of is the tightenco/collect object.

Getting all users

Narrowing Responses

To start at the second entry and get the next two items:

Caching

The Okta PHP SDK allows any resource with a self link to be cached by default. The SDK uses any PSR-6 caching adaptor that you would like to use. By default, we ship with the filesystem cache pool with the flysystem memory adaptor. By doing this, there is no need to configure anything, however, if you would like to run with your own Cache strategy, or change how the default works, you are able to swap out the Cache Manager. Create a new Cache Manager that extends the base \Okta\Cache\CacheManager class, and call the parent setCachePool() method. This should be called with an instance of a PSR-6 compliant cache pool implementation. Once created, you can swap out the manager using the ClientBuilder class

Contents of the okta.yaml File

When you use OAuth 2.0 the full YAML configuration looks like:

You can pass the path to your private key pem file as well instead of copying the pem string into the YAML configuration E.g PrivateKey: /Path/to/privateKey.pem

For information on what can go into the query property, visit our documentation


All versions of okta-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
psr/http-message Version ^1.0
php-http/client-common Version ^1.6
php-http/httplug Version ^1.1
php-http/message Version ^1.5
php-http/discovery Version ^1.2
php-http/curl-client Version ^1.7
symfony/yaml Version ^3.2|^4.3|^5.2
nesbot/carbon Version ^2.0
guzzlehttp/psr7 Version ^1.4
psr/cache Version ^1.0
league/flysystem-memory Version ^1.0
cache/filesystem-adapter Version ^1.0
lcobucci/jwt Version ^4.0@alpha
illuminate/collections Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pubpackage/okta-sdk-php contains the following files

Loading the files please wait ....