Merge branch 'master' into v1.1
This commit is contained in:
commit
dac7c3936f
12
README.md
12
README.md
|
@ -260,6 +260,18 @@ function onClickLogin() {
|
|||
onChangeProvider('oauth3.org');
|
||||
```
|
||||
|
||||
A user's e-mail can be passed into the clientParams object as `clientParams.subject`.
|
||||
|
||||
To auto-populate the e-mail input of the login popup, make sure the input has the class `js-oauth3-email`.
|
||||
|
||||
Example:
|
||||
```js
|
||||
if (clientParams.subject) {
|
||||
$('.js-oauth3-email').val(clientParams.subject);
|
||||
$('.js-authn-show').prop('disabled', false);
|
||||
}
|
||||
```
|
||||
|
||||
### Compatibility with Frameworks and Libraries
|
||||
|
||||
**jQuery**:
|
||||
|
|
|
@ -70,4 +70,17 @@ OAUTH3.api['account.addAddress'] = function (providerUri, opts) {
|
|||
});
|
||||
};
|
||||
|
||||
OAUTH3.api['account.removeAddress'] = function (providerUri, opts) {
|
||||
var session = opts.session;
|
||||
|
||||
return OAUTH3.request({
|
||||
method: 'DELETE'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/com.daplie.me/accounts/' + session.token.sub + '/addresses/' + opts.addressId
|
||||
, session: session
|
||||
}).then(function (res) {
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
}('undefined' !== typeof exports ? exports : window));
|
||||
|
|
|
@ -297,10 +297,13 @@
|
|||
debug: opts.debug || undefined
|
||||
, client_uri: opts.client_uri || opts.clientUri || undefined
|
||||
, client_id: opts.client_id || opts.client_uri || undefined
|
||||
, subject: opts.subject
|
||||
, state: state
|
||||
};
|
||||
var result;
|
||||
|
||||
console.log('implicitGrant opts.subject: ', opts.subject);
|
||||
|
||||
params.response_type = responseType;
|
||||
if (scope) {
|
||||
params.scope = OAUTH3.scope.stringify(scope);
|
||||
|
@ -712,6 +715,7 @@
|
|||
, client_id: opts.client_id || opts.client_uri
|
||||
, client_uri: opts.client_uri || opts.client_id
|
||||
, scope: opts.scope
|
||||
, subject: opts.subject
|
||||
, state: opts._state || undefined
|
||||
, debug: opts.debug
|
||||
}
|
||||
|
|
|
@ -188,7 +188,9 @@
|
|||
return OAUTH3.PromiseA.reject(new Error('JWK of type '+jwk.kty+' missing fields ' + missing));
|
||||
}
|
||||
|
||||
var jwkStr = '{' + keys.map(function (name) { return name+':'+jwk[name]; }).join(',') + '}';
|
||||
// I'm not actually 100% sure this behavior is guaranteed, but when we use an array as the
|
||||
// replacer argument the keys are always in the order they appeared in the array.
|
||||
var jwkStr = JSON.stringify(jwk, keys);
|
||||
return OAUTH3.crypto.core.sha256(OAUTH3._binStr.binStrToBuffer(jwkStr))
|
||||
.then(OAUTH3._base64.bufferToUrlSafe);
|
||||
};
|
||||
|
|
|
@ -71,6 +71,21 @@ OAUTH3.api['devices.detach'] = function (providerUri, opts) {
|
|||
});
|
||||
};
|
||||
|
||||
OAUTH3.api['devices.destroy'] = function (providerUri, opts) {
|
||||
var session = opts.session;
|
||||
var device = opts.device;
|
||||
|
||||
return OAUTH3.request({
|
||||
url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/com.daplie.domains/accounts/' + session.token.sub
|
||||
+ '/devices/' + device
|
||||
, method: 'DELETE'
|
||||
, session: session
|
||||
}, {}).then(function (res) {
|
||||
return res.data.device || res.data;
|
||||
});
|
||||
};
|
||||
|
||||
OAUTH3.api['dns.set'] = function (providerUri, opts) {
|
||||
var session = opts.session;
|
||||
var tld = opts.tld;
|
||||
|
|
|
@ -45,6 +45,22 @@ OAUTH3.api['domains.list'] = function (providerUri, opts) {
|
|||
});
|
||||
};
|
||||
|
||||
// TODO: Manual Renew Function
|
||||
OAUTH3.api['domains.extend'] = function (providerUri, opts) {
|
||||
var session = opts.session;
|
||||
|
||||
return OAUTH3.request({
|
||||
method: 'POST'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/com.daplie.domains/accounts/' + session.token.sub + '/registrations/' + opts.data.tld + '/' + opts.data.sld + '/extend'
|
||||
, session: session
|
||||
, data: opts.data
|
||||
}).then(function (res) {
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
OAUTH3.api['ns.list'] = function (providerUri, opts) {
|
||||
var session = opts.session;
|
||||
var domain = opts.domain;
|
||||
|
@ -77,7 +93,7 @@ OAUTH3.api['ns.list'] = function (providerUri, opts) {
|
|||
};
|
||||
|
||||
OAUTH3.api['ns.add'] = function (providerUri, opts) {
|
||||
var session = opts.session
|
||||
var session = opts.session;
|
||||
var server = opts.server;
|
||||
var tld = opts.tld;
|
||||
var sld = opts.sld;
|
||||
|
|
|
@ -422,6 +422,7 @@ OAUTH3.authz.redirectWithToken = function (providerUri, session, clientParams, s
|
|||
, response_type: clientParams.response_type
|
||||
, referrer: clientParams.referrer
|
||||
, session: session
|
||||
, subject: clientParams.subject
|
||||
, debug: clientParams.debug
|
||||
}).then(function (results) {
|
||||
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"provider_uri": "https://oauth3.org",
|
||||
"client_uri": "oauth3.org",
|
||||
"token_type": "bearer",
|
||||
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIzOTZjMzJlNzE1NmIzNGI1ZWY1ZWYwZWU4Zjk3Y2NiMyIsImlhdCI6MTQ5MDE5NzUyNywiaXNzIjoib2F1dGgzLm9yZyIsImF1ZCI6Im9hdXRoMy5vcmciLCJhenAiOiJvYXV0aDMub3JnIiwic3ViIjoiIiwia2lkIjoib2F1dGgzLm9yZyIsInNjcCI6IiIsImFzIjoibG9naW4iLCJncnQiOiJwYXNzd29yZCIsInNydiI6ZmFsc2UsImsiOiJvYXV0aDMub3JnIiwiYXBwIjoib2F1dGgzLm9yZyIsImFjeCI6eyJpZCI6IjE1LUxhM3JnZXBFelBCR0xITHlrdEZOT1NDZFNVOXZJdjlKc2EzTkMxYVJUc3ZmUTZ5cDJuVFFfZWxmdkhzYTEifSwiYXhzIjpbXSwidXNyIjoiYTM3YWVkYTk5ZDQ5MThhMDM0YzM0MmQ2NGNkZjRiN2V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tNGJlNi04NDcyLTQ1ZDBjNDMxZjdhZCJ9LCJhY3MiOltdLCJpZHgiOiJuZnZ1bHRETE0tT0EzVUV3dVJHTDE3RFY1UXpIbWhac005Z2xMdnFLVGJacGh1T0NqMnBEUzByRk9XSXhaRjZLIiwicmVmcmVzaCI6dHJ1ZX0.QfufVyAGit2YOy9Hs9mv4eoCuyCYb9FDT_UXGd3JaFZe6MwqxLLnq2fWkkV2jgzDAK5t0JMu2Vk91jPP2IBXMkpZSzjaEKJ3-Eokb14Mo5GIrp54ndM20gWVZc-ReQtOUtSVG28bfnOBT5ceUM6SBrTxfz1ENOfmAiWl5591roQ",
|
||||
"token": {
|
||||
"jti": "396c32e7156b34b5ef5ef0ee8f97ccb3",
|
||||
"iat": 1490197527,
|
||||
"iss": "oauth3.org",
|
||||
"aud": "oauth3.org",
|
||||
"azp": "oauth3.org",
|
||||
"sub": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1",
|
||||
"kid": "oauth3.org",
|
||||
"scp": "",
|
||||
"as": "login",
|
||||
"grt": "password",
|
||||
"srv": false,
|
||||
"k": "oauth3.org",
|
||||
"app": "oauth3.org",
|
||||
"acx": {
|
||||
"id": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1"
|
||||
},
|
||||
"axs": [],
|
||||
"usr": "a37aeda99d4918a034c342d64cdf4b7ed234dfe5",
|
||||
"acc": {
|
||||
"id": "53e50196-18e3-4be6-8472-45d0c431f7ad"
|
||||
},
|
||||
"acs": [],
|
||||
"idx": "nfvultDLM-OA3UEwuRGL17DV5QzHmhZsM9glLvqKTbZphuOCj2pDS0rFOWIxZF6K",
|
||||
"tokenType": "bearer",
|
||||
"exp": 1490199327,
|
||||
"ip": "207.173.165.50",
|
||||
"client_uri": "oauth3.org",
|
||||
"provider_uri": "https://oauth3.org"
|
||||
},
|
||||
"refresh": {
|
||||
"jti": "48ba62a5414ae8479ba3040d53796f72",
|
||||
"iat": 1490197527,
|
||||
"iss": "oauth3.org",
|
||||
"aud": "oauth3.org",
|
||||
"azp": "oauth3.org",
|
||||
"sub": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1",
|
||||
"kid": "oauth3.org",
|
||||
"scp": "",
|
||||
"as": "login",
|
||||
"grt": "password",
|
||||
"srv": false,
|
||||
"k": "oauth3.org",
|
||||
"app": "oauth3.org",
|
||||
"acx": {
|
||||
"id": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1"
|
||||
},
|
||||
"axs": [],
|
||||
"usr": "a37aeda99d4918a034c342d64cdf4b7ed234dfe5",
|
||||
"acc": {
|
||||
"id": "53e50196-18e3-4be6-8472-45d0c431f7ad"
|
||||
},
|
||||
"acs": [],
|
||||
"idx": "nfvultDLM-OA3UEwuRGL17DV5QzHmhZsM9glLvqKTbZphuOCj2pDS0rFOWIxZF6K",
|
||||
"refresh": true,
|
||||
"provider_uri": "https://oauth3.org"
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"provider_uri": "https://oauth3.org",
|
||||
"client_uri": "oauth3.org",
|
||||
"token_type": "bearer",
|
||||
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI4MmU5MDhlMTljMmIxM2IxNmM3N2JlMTNkMTljZmEzOSIsImlhdCI6MTQ5MDEzODg2MiwiaXNzIjoib2F1dGgzLm9yZyIsImF1ZCI6Im9hdXRoMy5vcmciLCJhenAiOiJvYXV0aDMub3JnIiwic3ViIjoiIiwia2lkIjoib2F1dGgzLm9yZyIsInNjcCI6IiIsImFzIjoibG9naW4iLCJncnQiOiJwYXNzd29yZCIsInNydiI6ZmFsc2UsImsiOiJvYXV0aDMub3JnIiwiYXBwIjoib2F1dGgzLm9yZyIsImF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lKc2EzTkMxYVJUc3ZmUTZ5cDJuVFFfZWxmdkhzYTEifSwiYXhzIjpbXSwidXNyIjoiYTM3YWVkYTk5ZDQ5MThhMDM0YzM0MmQ2NGNkZjRiN2VkMjM0ZGZlNSIsImFjYyI6eyJpZCI6IjUzZTUwMTk2LTE4ZTMtNGJlNi04NDcyLTQ1ZDBjNDMxZjdhZCJ9LCJhY3MiOltdLCJpZHgiOiJuZnZ1bHRETE0tT0EzVUV3dVJHTDE3RFY1UXpIbWhac005Z2xMdnFLVGJacGh1T0NqMnBEUzByRk9XSXhaRjZLIiwicmVmcmVzaCI6dHJ1ZX0.XljVX_QXgnYw8gyIZjQdxfyDlAAwWtU-kLitibw2_3xo9muLFPCL_dAk5XnMRygyyh5B9H4p4qB2Gb5BEJKJRfAtQ6TeZadTBtxwoY7zcns9f4Nx59VNii4k_Xp3uhJ6fQp8ERvkMgBy52Sj5ag0PFnuIwk35wLdSfiikDGnwKo",
|
||||
"token": {
|
||||
"jti": "82e908e19c2b13b16c77be13d19cfa39",
|
||||
"iat": 1490138862,
|
||||
"iss": "oauth3.org",
|
||||
"aud": "oauth3.org",
|
||||
"azp": "oauth3.org",
|
||||
"sub": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1",
|
||||
"kid": "oauth3.org",
|
||||
"scp": "",
|
||||
"as": "login",
|
||||
"grt": "password",
|
||||
"srv": false,
|
||||
"k": "oauth3.org",
|
||||
"app": "oauth3.org",
|
||||
"acx": {
|
||||
"id": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1"
|
||||
},
|
||||
"axs": [],
|
||||
"usr": "a37aeda99d4918a034c342d64cdf4b7ed234dfe5",
|
||||
"acc": {
|
||||
"id": "53e50196-18e3-4be6-8472-45d0c431f7ad"
|
||||
},
|
||||
"acs": [],
|
||||
"idx": "nfvultDLM-OA3UEwuRGL17DV5QzHmhZsM9glLvqKTbZphuOCj2pDS0rFOWIxZF6K",
|
||||
"tokenType": "bearer",
|
||||
"exp": 1490140662,
|
||||
"ip": "207.173.165.50",
|
||||
"client_uri": "oauth3.org",
|
||||
"provider_uri": "https://oauth3.org"
|
||||
},
|
||||
"refresh": {
|
||||
"jti": "5d0c0c25926fa6c193429aedd22c912b",
|
||||
"iat": 1490138862,
|
||||
"iss": "oauth3.org",
|
||||
"aud": "oauth3.org",
|
||||
"azp": "oauth3.org",
|
||||
"sub": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1",
|
||||
"kid": "oauth3.org",
|
||||
"scp": "",
|
||||
"as": "login",
|
||||
"grt": "password",
|
||||
"srv": false,
|
||||
"k": "oauth3.org",
|
||||
"app": "oauth3.org",
|
||||
"acx": {
|
||||
"id": "15-La3rgepEzPBGLHLyktFNOSCdSU9vIv9Jsa3NC1aRTsvfQ6yp2nTQ_elfvHsa1"
|
||||
},
|
||||
"axs": [],
|
||||
"usr": "a37aeda99d4918a034c342d64cdf4b7ed234dfe5",
|
||||
"acc": {
|
||||
"id": "53e50196-18e3-4be6-8472-45d0c431f7ad"
|
||||
},
|
||||
"acs": [],
|
||||
"idx": "nfvultDLM-OA3UEwuRGL17DV5QzHmhZsM9glLvqKTbZphuOCj2pDS0rFOWIxZF6K",
|
||||
"refresh": true,
|
||||
"provider_uri": "https://oauth3.org"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue