By: Xuejiao Zhang user 29 Aug 2019 at 8:29 a.m. CDT

2 Responses
Xuejiao Zhang gravatar
When I tried to get id Token using Javascript, I got the complaints '{"error":"unauthorized_client","error_description":"The client is not authorized to request an access token using this method.","state":"xxxx"}' Do you have any clue about the error? By the way, instead of coding from scratch, is there sample/doc to get id Token? Thanks in advance,

By Aliaksandr Samuseu staff 30 Aug 2019 at 3:13 p.m. CDT

Aliaksandr Samuseu gravatar
Hi, Xuejiao. We don't recommend implementing clients yourself, and can't provide support under Community Support terms for such cases as well - due to sheer complexity of such task. You are advised to use existing solutions. There is doc on JScript client that was tested with Gluu Server before [here](https://gluu.org/docs/ce/3.1.6/integration/spa/oauth-js-implicit/). You could study or re-use it for your project. As for the error you quoted, you need to make sure your OIDC client is registered at Gluu Server, and configured properly. "Properly" depends on a lot of things, in particular on what kind of flow you try to use. You can check [the spec](https://openid.net/specs/openid-connect-core-1_0.html) if not sure. Unless more details (trafic captures/HAR files, dumps of HTTP requests and responses, logs etc) are provided, it's hard to suggest more than that.

By Xuejiao Zhang user 31 Aug 2019 at 9:07 a.m. CDT

Xuejiao Zhang gravatar
@Aliaksandr.Samuseu Thanks. I tried with the JScript cliend recommended by you exactly as the [example](https://github.com/GluuFederation/openid-implicit-client/tree/master/javascript-sample) here. I got the following complain, Do you have any clue? Thanks again. ``` OidcException {name: "OidcException", message: "Unable to get the ID Token from the current page U…eption: Unsupported JWS signature algorithm HS256"} message: "Unable to get the ID Token from the current page URL: OidcException: Unable to verify the ID Token signature: OidcException: Unsupported JWS signature algorithm HS256" name: "OidcException" __proto__: Error at https://gluutesttoken.s3.us-east-2.amazonaws.com/openidconnect.js:1254:27 OIDC.getValidIdToken @ openidconnect.js:914 ```