Skip to content
Snippets Groups Projects
Commit 5a44cc51 authored by Stefan Auditor's avatar Stefan Auditor Committed by Stefan Auditor
Browse files

Issue #2838394 by sanduhrs: Provide documentation for creating custom client

parent 4733c0a3
No related branches found
No related tags found
No related merge requests found
name = OpenID Connect Example
description = A example client implementation for the OpenID Connect protocol.
core = 7.x
package = OAuth2
hidden = true
dependencies[] = openid_connect
<?php
/**
* @file
* An example implementation of OpenID Connect client.
*/
/**
* Implements hook_ctools_plugin_directory().
*/
function openid_connect_example_ctools_plugin_directory($module, $plugin) {
if ($module == 'openid_connect') {
return 'plugins/' . $plugin;
}
}
<?php
/**
* @file
* An example implementation of OpenID Connect client.
*/
/**
* Custom OpenID Connect client.
*/
class OpenIDConnectClientExample extends OpenIDConnectClientBase {
/**
* {@inheritdoc}
*/
public function settingsForm() {
$form = parent::settingsForm();
return $form;
}
/**
* {@inheritdoc}
*/
public function getEndpoints() {
return array(
'authorization' => 'https://example.com/oauth2/authorize',
'token' => 'https://example.com/oauth2/token',
'userinfo' => 'https://example.com/oauth2/UserInfo',
);
}
}
<?php
/**
* @file
* Provides an example OpenID Connect client plugin.
*/
$plugin = array(
'title' => t('Example'),
'class' => 'OpenIDConnectClientExample',
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment