David Meir-Levy
David Meir-Levy

Reputation: 252

Logto | TypeError: device_authorization_endpoint must be configured on the issuer

I'm migrating from auth0 to logto. In my CLI tool, we have a command to "login". It used standard openid-client technique:

import { Issuer, errors } from 'openid-client';
import open from 'open';

const AUTH_DOMAIN = 'http://localhost:3001/oidc';
const AUTH_IDENTIFIER = '[MY_APP_URL]'

const auth = await Issuer.discover(AUTH_DOMAIN);
const client = new auth.Client({
  client_id: AUTH0_CLIENT_ID,
  token_endpoint_auth_method: 'none',
  id_token_signed_response_alg: 'RS256', // Also tried HS256
});

//////
// This line throws the error:
const handle = await client.deviceAuthorization({ audience: AUTH_IDENTIFIER }); 
///////
const { user_code: userCode, verification_uri_complete: verificationUriComplete, expires_in: expiresIn } = handle;

await open(verificationUriComplete);

const tokens = await handle.poll();

if (!tokens?.access_token) {
  throw new Error('no access token');
}

The error I get from this code after migrating to Logto is:

TypeError: device_authorization_endpoint must be configured on the issuer
    at assertIssuerConfiguration 

I know that the authorization endpoint is: http://[LOGTO_DOMAIN]/oidc/auth, but where do i put it? what am I missing to make this work?

Upvotes: 0

Views: 38

Answers (0)

Related Questions