This repository has been archived by the owner on Jul 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhid_auth.oauthconnector.inc
71 lines (68 loc) · 1.91 KB
/
hid_auth.oauthconnector.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* @file
* hid_auth.oauthconnector.inc
*/
/**
* Implements hook_default_oauthconnector_provider().
*/
function hid_auth_default_oauthconnector_provider() {
$export = array();
$provider = new stdClass();
$provider->disabled = FALSE; /* Edit this to true to make a default provider disabled initially */
$provider->api_version = 1;
$provider->name = 'hid_oauth';
$provider->title = 'Humanitarian ID Oauth';
$provider->url = 'http://hid.local:3000';
$provider->consumer_advanced = array(
'oauth2' => 1,
'signature method' => 'HMAC-SHA1',
'authentication realm' => '',
'request token endpoint' => '/oauth/request_token',
'authorization scope' => 'hid:full',
'authorization endpoint' => '/oauth/authorize',
'access token endpoint' => '/oauth/access_token',
);
$provider->mapping = array(
'fields' => array(
'uid' => array(
'resource' => 'http://hid.local:3000/account.json',
'method post' => 0,
'field' => 'user_id',
'querypath' => FALSE,
'sync_with_field' => '',
),
'email' => array(
'resource' => 'http://hid.local:3000/account.json',
'method post' => 0,
'field' => 'email',
'querypath' => FALSE,
'sync_with_field' => 'mail',
),
'name' => array(
'resource' => '',
'method post' => 0,
'field' => '',
'querypath' => FALSE,
'sync_with_field' => '',
),
'name' => array(
'resource' => 'http://hid.local:3000/account.json',
'method post' => 0,
'field' => 'email',
'querypath' => FALSE,
'sync_with_field' => 'name',
),
'avatar' => array(
'resource' => '',
'method post' => 0,
'field' => '',
'querypath' => FALSE,
'sync_with_field' => '',
),
),
'format' => 'json',
);
$export['hid_oauth'] = $provider;
return $export;
}