~emersion/gamja

3c264c4c92903f98feca5bd96c8343b9a67f03ff — Simon Ser 1 year, 3 months ago 2c3fbdd check-oauth-token-endpoint-auth-methods
Check OAuth 2.0 token_endpoint_auth_methods_supported
1 files changed, 14 insertions(+), 0 deletions(-)

M components/app.js
M components/app.js => components/app.js +14 -0
@@ 397,6 397,20 @@ export default class App extends Component {
			return;
		}

		var authMethods = serverMetadata.token_endpoint_auth_methods_supported || ["client_secret_basic"];
		var authMethodErr = null;
		if (this.config.oauth2.client_secret && !authMethods.includes("client_secret_basic")) {
			authMethodErr = "OAuth 2.0 server doesn't support HTTP basic authentication on the token endpoint";
		}
		if (!this.config.oauth2.client_secret && !authMethods.includes("none")) {
			authMethodErr = "OAuth 2.0 server doesn't support public clients on the token endpoint";
		}
		if (authMethodErr) {
			console.error(authMethodErr);
			this.showError(authMethodErr);
			return;
		}

		oauth2.redirectAuthorize({
			serverMetadata,
			clientId: this.config.oauth2.client_id,