Skip to content

Commit

Permalink
Merge pull request #14 from nswdpc/remove-okta-sdk
Browse files Browse the repository at this point in the history
Remove okta/sdk and related usage
  • Loading branch information
JamesDPC authored Jul 26, 2024
2 parents fcf4ae2 + 7fbd8e6 commit 37ef482
Show file tree
Hide file tree
Showing 28 changed files with 6 additions and 2,131 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,13 @@ With this module you can
+ Link a user to an Okta group
+ Optionally disallow/allow the default member authenticator alongside Okta auth

### Okta API

+ Create an Okta API client using [okta/sdk](https://github.com/okta/okta-sdk-php)
+ Synchronise users via a queued job (via Okta API)
+ Block sign-in for those Okta users who have stopped appearing for a configured time period in synchronisation results
+ Optionally remove users who have not synchronised after a certain time.

Use of the Okta API is optional.

## You will need

+ An Okta account
+ An Okta OAuth service application configured with scopes granted
+ If you require multiple sites authenticating via Okta, a service application per site.
+ A `clientId` and `clientSecret` for OAuth

### Okta API

+ To work with the Okta API, you will need an Okta API token

## Documentation

[Start here](./docs/en/001_index.md) for project setup and configuration examples.
Expand All @@ -50,10 +37,6 @@ composer require nswdpc/silverstripe-okta-boilerplate
```
After installing the module, run a `dev/build` then [start with the documentation](./docs/en/001_index.md).

## TODO

+ Private Key authentication mode

## License

[BSD-3-Clause](./LICENSE.md)
Expand Down
14 changes: 0 additions & 14 deletions _config/api.yml

This file was deleted.

3 changes: 0 additions & 3 deletions _config/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ Bigfork\SilverStripeOAuth\Client\Form\LoginForm:
SilverStripe\Security\Security:
extensions:
- 'NSWDPC\Authentication\Okta\SecurityControllerExtension'
SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest:
extensions:
- 'NSWDPC\Authentication\Okta\MemberOktaSyncExtension'
10 changes: 2 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"silverstripe",
"authentication",
"okta",
"oauth2",
"okta php api"
"oauth2"
],
"extra": {
"expose": [
Expand All @@ -24,17 +23,13 @@
"php": ">=7.3 || ^8",
"bigfork/silverstripe-oauth-login": "^2.2",
"foxworth42/oauth2-okta": "^1",
"okta/sdk": "^1.3 || ^2",
"silverstripe/framework": "^4.10.0",
"phptek/jsontext": "^2",
"symbiote/silverstripe-queuedjobs": "^4.9.0",
"cache/void-adapter": "^1.2.0",
"php-http/message-factory": "^1.1"
"symbiote/silverstripe-queuedjobs": "^4.9.0"
},
"require-dev": {
"mockery/mockery": "^1.5",
"phpunit/phpunit": "^9.5",
"web-token/jwt-key-mgmt" : "^2.2",
"friendsofphp/php-cs-fixer": "^3"
},
"autoload": {
Expand All @@ -46,7 +41,6 @@
"src/Handler/",
"src/Jobs/",
"src/Models/",
"src/Reports/",
"src/Services/",
"src/Tasks/",
"src/Traits/"
Expand Down
2 changes: 0 additions & 2 deletions docs/en/001_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Documentation

1. [OAuth client setup](./002_oauth_login.md)
1. [API setup](./003_okta_api.md)
1. [Example project configuration](./004_example_project_configuration.md)
1. [Considerations](./099_considerations.md)

Expand All @@ -11,7 +10,6 @@ This module uses the following libraries and Silverstripe vendor modules to prov

+ [bigfork/silverstripe-oauth-login](https://github.com/bigfork/silverstripe-oauth-login) + dependencies
+ [foxworth42/oauth2-okta](https://github.com/foxworth42/oauth2-okta), a [league/oauth2-client](https://github.com/thephpleague/oauth2-client) client
+ [okta/sdk](https://github.com/okta/okta-sdk-php)
+ [silverstripe/framework](https://github.com/silverstripe/silverstripe-framework)

Configuring your Okta OAuth service application is outside the scope of this document. [Okta provides good documentation](https://developer.okta.com/docs/guides/implement-oauth-for-okta/create-oauth-app/).
Expand Down
140 changes: 0 additions & 140 deletions docs/en/003_okta_api.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/en/004_example_project_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ Bigfork\SilverStripeOAuth\Client\Mapper\GenericMemberMapper:
'FirstName': 'FirstName'
'Surname': 'Surname'
---
Name: app-okta-api
After:
- '#silverstripe-okta-api'
---
# API client options
NSWDPC\Authentication\Okta\ClientFactory:
default_file_location: '/path/to/okta.yaml'
config_file_location: null
application_client_id: 'not-a-client-id'
---
Name: app-okta-linker
After:
- silverstripe-okta-linker
Expand Down
10 changes: 0 additions & 10 deletions src/Exceptions/OktaAppUserSyncException.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Exceptions/OktaClientException.php

This file was deleted.

14 changes: 1 addition & 13 deletions src/Extensions/MemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,6 @@ public function updateCmsFields($fields)
'OktaProfileLogin',
_t('OKTA.PROFILE_LOGIN', 'Okta login')
),
LabelField::create(
'OktaProfileLabel',
_t('OKTA.PROFILE_FIELD_TITLE', 'Latest profile data')
),
LiteralField::create(
'OktaProfileValue',
'<pre>' . htmlspecialchars($this->formatOktaProfileValue()) . '</pre>'
),
CompositeField::create(
ReadonlyField::create(
'OktaLastSync',
Expand All @@ -223,11 +215,7 @@ public function updateCmsFields($fields)
'Clear this value'
)
)
),
ReadonlyField::create(
'OktaUnlinkedWhen',
_t('OKTA.UNLINKED_DATETIME', 'When this member was unlinked from an Okta profile')
),
)
)->setTitle(
_t('OKTA.OKTA_HEADING', 'Okta')
)
Expand Down
Loading

0 comments on commit 37ef482

Please sign in to comment.