定制 dakkusingh/oktasdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dakkusingh/oktasdk

最新稳定版本:1.2.12

Composer 安装命令:

composer require dakkusingh/oktasdk

包简介

PHP client library for the Okta API (v1)

README 文档

README

Latest Stable Version Total Downloads License Build Status

PHP client library for the Okta API (v1)

Refer to the full Okta API documentation for more complete information on each resource/component.

Install with Composer

composer require dakkusingh/oktasdk

Initializing the Client

To initialize the client object you must pass in your Okta organization subdomain and API key as parameters. For example, if your Okta domain is https://foo.okta.com, your org prefix is foo. For instructions on how to get an API key for your organization, see Obtaining a token.

Example:

use Okta;

$okta = new Okta\Client('foo', 'api_key');

You may also optionally pass an array of config options as the third argument:

$okta = new Okta\Client('foo', 'api_key', [
    'bootstrap' => false, // Don't auto-bootstrap the Okta resource properties
    'preview'   => true,  // Use the okta preview (oktapreview.com) domain
    'headers'   => [
        'Some-Header'    => 'Some value',
        'Another-Header' => 'Another value'
    ]
]);

Usage

All Okta resources are available via the $okta->$resource->$method syntax where $resource is the lower case, singular name of the resource (i.e. - Users = user, Groups = group, etc.) and $method is the method name (see the docs for all available methods). The only exception being the Authentication resource for which the method name is auth (because authentication is just too long).

Example:

// Get a user by ID
$user = $okta->user->get('jpinkerton');

// Add user to a group
$group = $okta->group->addUser($someGroupId, $user->id);

// Get a user's apps
$userApps = $okta->user->apps($user->id);

Handling Exceptions

use Okta;

try {
    $user = $okta->user->get('jpinkerton');
} catch (Okta\Exception as $e) {
    return $e->getErrorSummary();
}

See documentation for available exception methods.

Contributing

  1. Fork the repository

  2. Clone your fork:

    git clone git@github.com:your-username/oktasdk-php.git
    # NOTE: Be sure to use your fork's repository URL
  3. In your local copy, create a branch:

    git checkout -b descriptive-branch-name'
  4. Make your changes

  5. Commit your changes:

    git commit -m "Your commit notes here"
    # NOTE: Be descriptive with your commit notes
  6. Push your branch:

    git push origin descriptive-branch-name
  7. Open a Pull Request on GitHub.

Copyright

This project is liscensed under the MIT License.

统计信息

  • 总下载量: 97.04k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-11