From 9cb2ad036b3f3c1f9a84bc10e25e661049055c9d Mon Sep 17 00:00:00 2001 From: Drew Warren Date: Tue, 4 Jul 2017 13:22:30 -0600 Subject: [PATCH 01/10] Add removeAddress and extend functionality --- oauth3.account.js | 13 +++++++++++++ oauth3.domains.js | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/oauth3.account.js b/oauth3.account.js index 030d65d..5e73122 100644 --- a/oauth3.account.js +++ b/oauth3.account.js @@ -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)); diff --git a/oauth3.domains.js b/oauth3.domains.js index 833a745..191f13c 100644 --- a/oauth3.domains.js +++ b/oauth3.domains.js @@ -45,21 +45,21 @@ OAUTH3.api['domains.list'] = function (providerUri, opts) { }); }; -/* TODO: Manual Renew Function +// 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.tld + '/' + opts.sld + '/extend' + + '/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; From 186c0ea45a6f27c45278b1598b9ecec1251c9884 Mon Sep 17 00:00:00 2001 From: Drew Warren Date: Wed, 5 Jul 2017 16:16:51 -0600 Subject: [PATCH 02/10] Add subject to implicitGrant --- oauth3.core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/oauth3.core.js b/oauth3.core.js index ff2f9be..7f11c4c 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -297,6 +297,7 @@ 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; From 9574d9b982f7a1578cdbe828f259fc045b0f9b68 Mon Sep 17 00:00:00 2001 From: Drew Warren Date: Wed, 5 Jul 2017 16:38:14 -0600 Subject: [PATCH 03/10] Add subject to clientParams --- oauth3.core.js | 4 ++++ oauth3.issuer.js | 1 + 2 files changed, 5 insertions(+) diff --git a/oauth3.core.js b/oauth3.core.js index f14d429..cb318eb 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -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 } diff --git a/oauth3.issuer.js b/oauth3.issuer.js index 257a196..19f3dc2 100644 --- a/oauth3.issuer.js +++ b/oauth3.issuer.js @@ -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) { From 146891a6186c6c2916b37307a0b14f74094e3bd6 Mon Sep 17 00:00:00 2001 From: Drew Warren Date: Fri, 7 Jul 2017 11:45:37 -0600 Subject: [PATCH 04/10] update README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 435fd54..5ccbddb 100644 --- a/README.md +++ b/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**: From e930881e0f388a83a439f71c0477088f44070819 Mon Sep 17 00:00:00 2001 From: Drew Warren Date: Wed, 12 Jul 2017 16:11:01 -0600 Subject: [PATCH 05/10] Add devices.destroy API call --- oauth3.dns.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/oauth3.dns.js b/oauth3.dns.js index e81f9c5..777bd23 100644 --- a/oauth3.dns.js +++ b/oauth3.dns.js @@ -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; From 1993853d0dff73a5486ba3af16d3e7768249aeb2 Mon Sep 17 00:00:00 2001 From: tigerbot Date: Fri, 28 Jul 2017 10:54:56 -0600 Subject: [PATCH 06/10] removed some files that shouldn't have been committed --- oauth3.org.directives.json | 66 -------------------------------------- oauth3.org.session.json | 66 -------------------------------------- 2 files changed, 132 deletions(-) delete mode 100644 oauth3.org.directives.json delete mode 100644 oauth3.org.session.json diff --git a/oauth3.org.directives.json b/oauth3.org.directives.json deleted file mode 100644 index 39a4515..0000000 --- a/oauth3.org.directives.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "provider_uri": "https://oauth3.org", - "client_uri": "oauth3.org", - "token_type": "bearer", - "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGki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MDE5NzUyNywiaXNzIjoib2F1dGgzLm9yZyIsImF1ZCI6Im9hdXRoMy5vcmciLCJhenAiOiJvYXV0aDMub3JnIiwic3ViIjoiIiwia2lkIjoib2F1dGgzLm9yZyIsInNjcCI6IiIsImFzIjoibG9naW4iLCJncnQiOiJwYXNzd29yZCIsInNydiI6ZmFsc2UsImsiOiJvYXV0aDMub3JnIiwiYXBwIjoib2F1dGgzLm9yZyIsImFjeCI6eyJpZCI6IjE1LUxhM3JnZXBFelBCR0xITHlrdEZOT1NDZFNVOXZJdjlKc2EzTkMxYVJUc3ZmUTZ5cDJuVFFfZWxmdkhzYTEifSwiYXhzIjpbXSwidXNyIjoiYTM3YWVkYTk5ZDQ5MThhMDM0YzM0MmQ2NGNkZjRiN2VkMjM0ZGZlNSIsImFjYyI6eyJpZCI6IjUzZTUwMTk2LTE4ZTMtNGJlNi04NDcyLTQ1ZDBjNDMxZjdhZCJ9LCJhY3MiOltdLCJpZHgiOiJuZnZ1bHRETE0tT0EzVUV3dVJHTDE3RFY1UXpIbWhac005Z2xMdnFLVGJacGh1T0NqMnBEUzByRk9XSXhaRjZLIiwicmVmcmVzaCI6dHJ1ZX0.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" - } -} \ No newline at end of file diff --git a/oauth3.org.session.json b/oauth3.org.session.json deleted file mode 100644 index a8c82f1..0000000 --- a/oauth3.org.session.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "provider_uri": "https://oauth3.org", - "client_uri": "oauth3.org", - "token_type": "bearer", - "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI4MmU5MDhlMTljMmIxM2IxNmM3N2JlMTNkMTljZmEzOSIsImlhdCI6MTQ5MDEzODg2MiwiaXN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IjoiIiwia2lkIjoib2F1dGgzLm9yZyIsInNjcCI6IiIsImFzIjoibG9naW4iLCJncnQiOiJwYXNzd29yZCIsInNydiI6ZmFsc2UsImsiOiJvYXV0aDMub3JnIiwiYXBwIjoib2F1dGgzLm9yZyIsImFjeCI6eyJpZCI6IjE1LUxhM3JnZXBFelBCR0xITHlrdEZOT1NDZFNVOXZJdjlKc2EzTkMxYVJUc3ZmUTZ5cDJuVFFfZWxmdkhzYTEifSwiYXhzIjpbXSwidXNyIjoiYTM3YWVkYTk5ZDQ5MThhMDM0YzM0MmQ2NGNkZjRiN2VkMjM0ZGZlNSIsImFjYyI6eyJpZCI6IjUzZTUwMTk2LTE4ZTMtNGJlNi04NDcyLTQ1ZDBjNDMxZjdhZCJ9LCJhY3MiOltdLCJpZHgiOiJuZnZ1bHRETE0tT0EzVUV3dVJHTDE3RFY1UXpIbWhac005Z2xMdnFLVGJacGh1T0NqMnBEUzByRk9XSXhaRjZLIiwicmVmcmVzaCI6dHJ1ZX0.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" - } -} \ No newline at end of file From 69add2a80f787a952363f2f06fb736c9455825fe Mon Sep 17 00:00:00 2001 From: aj Date: Tue, 1 Aug 2017 17:28:27 +0000 Subject: [PATCH 07/10] org.oauth3.provider -> issuer@oauth3.org --- well-known/oauth3/directives.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/well-known/oauth3/directives.json b/well-known/oauth3/directives.json index d2b477b..b710741 100644 --- a/well-known/oauth3/directives.json +++ b/well-known/oauth3/directives.json @@ -1,13 +1,13 @@ { "terms": [ "oauth3.org/tos/draft" ] , "api": "api.:hostname" , "authorization_dialog": { "url": "#/authorization_dialog" } -, "access_token": { "method": "POST", "url": "api/org.oauth3.provider/access_token" } -, "otp": { "method": "POST", "url": "api/org.oauth3.provider/otp" } -, "credential_otp": { "method": "POST", "url": "api/org.oauth3.provider/otp" } -, "credential_meta": { "url": "api/org.oauth3.provider/logins/meta/:type/:id" } -, "credential_create": { "method": "POST", "url": "api/org.oauth3.provider/logins" } -, "grants": { "method": "GET", "url": "api/org.oauth3.provider/grants/:azp/:sub" } -, "authorization_decision": { "method": "POST", "url": "api/org.oauth3.provider/authorization_decision" } +, "access_token": { "method": "POST", "url": "api/issuer@oauth3.org/access_token" } +, "otp": { "method": "POST", "url": "api/issuer@oauth3.org/otp" } +, "credential_otp": { "method": "POST", "url": "api/issuer@oauth3.org/otp" } +, "credential_meta": { "url": "api/issuer@oauth3.org/logins/meta/:type/:id" } +, "credential_create": { "method": "POST", "url": "api/issuer@oauth3.org/logins" } +, "grants": { "method": "GET", "url": "api/issuer@oauth3.org/grants/:azp/:sub" } +, "authorization_decision": { "method": "POST", "url": "api/issuer@oauth3.org/authorization_decision" } , "callback": { "method": "GET", "url": ".well-known/oauth3/callback.html#/" } , "logout": { "method": "GET", "url": "#/logout/" } } From 2cc96fef6e31911fc5cee9bc8846e1141733dcfe Mon Sep 17 00:00:00 2001 From: aj Date: Tue, 1 Aug 2017 18:04:25 +0000 Subject: [PATCH 08/10] org.oauth3 -> oauth3.org --- well-known/oauth3/callback.html | 2 +- well-known/oauth3/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/well-known/oauth3/callback.html b/well-known/oauth3/callback.html index 2b8eec9..019555c 100644 --- a/well-known/oauth3/callback.html +++ b/well-known/oauth3/callback.html @@ -15,7 +15,7 @@ - + +