Skip to content
English
  • There are no suggestions because the search field is empty.

Register an OAuth client and implement sign-in

Use one OAuth client for an application across its builds. Reuse the existing client rather than creating a new identity each time you deploy.

[Step] 1. Use an administrator MCP connection to register or reuse a PKCE client

  1. Connect ezeep MCP using an organization administrator account.
  2. Ask the assistant to check the connection’s roles and scopes. Client registration requires the accounts scope.
  3. Prepare the application name, consent-screen description and exact development and production callback URLs.
  4. Ask the assistant to call register_oauth_client, reusing a suitable existing public client if its redirect URLs already cover your application.

For example:

“Register or reuse a public PKCE OAuth client for my application, Acme Print Portal. Its callback URLs are https://app.example.com/oauth/callback and http://localhost:3000/oauth/callback. The consent description is ‘Print documents from Acme Print Portal.’ Use the default printing scopes and return the client ID.”

Replace the example name and callback URLs before using the prompt.

The tool returns a client ID and whether it reused a client. It does not issue a client secret for a public PKCE client.

[/Step]

Choose scopes and callback URLs

The MCP registration defaults cover printing, uploading documents, reading printers, OpenID and profile:

printing.print printing.documents.upload
printing.printers.readonly openid profile

Supply scopes as a space-separated string when calling the REST registration endpoint. Include every scope your application will request; a REST client created without allowed scopes issues tokens without scopes.

MCP registration accepts HTTPS callback URLs and http://localhost. Wildcards and fragments are not accepted. For native application schemes or confidential clients, use the OAuth-client management API.

[Step] 2. Implement Authorization Code with PKCE and validate the callback state

  1. Generate a random code verifier and its S256 challenge.
  2. Send the user’s browser to the authorization endpoint with response_type=code, your client ID, registered redirect URI, requested scopes, code challenge and code_challenge_method=S256. Use state to associate and validate the return to your application.
  3. On the callback, validate the returned state and capture the authorization code.
  4. Exchange the code at the token endpoint, including the original code verifier and the same redirect URI.
  5. Use the returned access token as a Bearer token for API requests.

Authorization endpoint:

https://account.ezeep.com/oauth/authorize/

Token endpoint:

https://account.ezeep.com/oauth/access_token/

For a public client, the token request uses an Authorization: Basic header containing the Base64 encoding of the client ID followed by a colon, with no secret. Send the form fields with Content-Type: application/x-www-form-urlencoded.

Follow the complete PKCE request and response reference for the exact fields.

[/Step]

[Step] 3. Refresh expired tokens and store each replacement refresh token

Reuse the access token until it expires. Refresh with grant_type=refresh_token and the current refresh token.

Refresh tokens rotate: each is single-use. Save the new access token and refresh token from the response, replacing the old refresh token in writable protected storage. Do not put a rotating refresh token into a fixed environment setting.

[/Step]

[Step] 4. Use the management API for confidential clients and client maintenance

The REST management API can create confidential clients, which receive a client secret once at creation. Keep that secret in the backend. Public-client examples that use no secret do not apply to confidential clients.

Use the management reference to list, update or delete clients and check the grant type, scopes and redirect URLs required for your application.

Continue to your first API print.

[/Step]