Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the wrong token_endpoint_auth_method: 'secret_basic' to 'client_secret_basic' and 'secret_post' to 'client_secret_post' #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions example/chapter10/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,12 +579,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion example/chapter10/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
4 changes: 2 additions & 2 deletions example/chapter8/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion example/chapter8/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
2 changes: 1 addition & 1 deletion example/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-11-ex-4/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-12-ex-1/completed/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ app.post('/register', function (req, res){
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-12-ex-1/completed/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'foo bar'
};

Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-12-ex-2/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ var checkClientMetadata = function(req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-12-ex-2/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'foo bar'
};

Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-12-ex-2/completed/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ var checkClientMetadata = function(req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-12-ex-2/completed/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'foo bar'
};

Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-6-ex-5/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-7-ex-1/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-8-ex-1/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-8-ex-1/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-8-ex-2/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/ch-8-ex-3/authorizationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ var checkClientMetadata = function (req, res) {
var reg = {};

if (!req.body.token_endpoint_auth_method) {
reg.token_endpoint_auth_method = 'secret_basic';
reg.token_endpoint_auth_method = 'client_secret_basic';
} else {
reg.token_endpoint_auth_method = req.body.token_endpoint_auth_method;
}

if (!__.contains(['secret_basic', 'secret_post', 'none'], reg.token_endpoint_auth_method)) {
if (!__.contains(['client_secret_basic', 'client_secret_post', 'none'], reg.token_endpoint_auth_method)) {
res.status(400).json({error: 'invalid_client_metadata'});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-8-ex-3/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-9-ex-1/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down
2 changes: 1 addition & 1 deletion exercises/ch-9-ex-2/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var registerClient = function() {
redirect_uris: ['http://localhost:9000/callback'],
grant_types: ['authorization_code'],
response_types: ['code'],
token_endpoint_auth_method: 'secret_basic',
token_endpoint_auth_method: 'client_secret_basic',
scope: 'openid profile email address phone'
};

Expand Down