Custom OIDC Provider: LINE Login fails with "unexpected algorithm, expected ES256 got HS256" #49056
Replies: 2 comments
|
I don't have suggestions on a workaround but Supabase custom oath is ES256 only. |
|
The Auth verifies the ID token with
So there is no dashboard toggle and no config value that makes this work: the verifier in use cannot do HMAC at all, and nothing you could put in The deeper reason it is not fixable by relaxing an algorithm list: LINE's HS256 web-login token is signed with your Channel Secret, and that key is published nowhere. Which leaves the practical route: keep LINE out of the Custom OIDC provider and do the exchange yourself in an Edge Function — trade the code at |
Uh oh!
There was an error while loading. Please reload this page.
I've set up LINE Login (https://developers.line.biz) as a Custom OAuth/OIDC
Provider in Supabase Auth (Auto-discovery method, issuer:
https://access.line.me).
The authorization flow completes successfully (user approves on LINE's
side, redirect back works), but the sign-in fails at the final step with:
error=server_error&error_code=unexpected_failure&
error_description=Error+getting+user+profile+from+external+provider
Checking the Auth Logs in the dashboard shows the underlying cause:
Failed to verify ID token: oidc: id token signed with unsupported
algorithm, expected ["ES256"] got "HS256"
According to LINE's own documentation
(https://developers.line.biz/en/docs/line-login/verify-id-token/), this is
expected behavior: LINE signs ID tokens with ES256 for native
apps/SDK/LIFF, but with HS256 (using the Channel Secret as the HMAC key)
for web-based login flows. This is not configurable on LINE's side.
Is there a way to configure the Custom OIDC Provider in Supabase to accept
HS256-signed ID tokens (using the Client Secret as the HMAC verification
key), either via the dashboard or via a config option? Or is this a
fundamental limitation of the current custom provider implementation?
Happy to provide more details (redacted logs, config) if useful.
All reactions