Contents
Authorization
Browser-facing part of the authorization code flow: sign-in, consent, redirect back with a code.
Base URL, authentication and conventions of this API are on the OAuth & OpenID Connect API page.
/oauth/authorizeStart the authorization code flow
Open this URL in the user's browser (not in an embedded web view). Nucleo:
- shows the Nucleo sign-in page (
/login) if the user has no session; - shows a consent screen naming your client and the requested scopes (Nucleo's own apps
skip it). Self-registered clients see the consent screen the first time, and again whenever the person has no valid token of that client covering the requested scopes; send
prompt=consentto always show it.; - redirects to
redirect_uriwithcodeandstate— or witherror=access_deniedif the user clicks Cancel.
PKCE is required for public clients (token_endpoint_auth_method: none) and only S256 is
advertised. Authorization codes are single-use and short-lived (10 minutes): exchange them
immediately at /oauth/token.
redirect_uri must match exactly one of the URIs registered for the client. Errors that make
the redirect unsafe (unknown client, unregistered redirect_uri) are shown to the user instead
of being redirected.
Query parameters
response_typestringrequiredOne ofcodeExample:codeclient_idstringrequiredExample:9d3f2b1c-6a4e-4f7b-9c2d-1e8a7b6c5d4fredirect_uristring (uri)requiredExample:https://assistant.acme.example/oauth/callbackscopestringSpace-separated. Unknown scopes are rejected with
invalid_scope.Example:openid profile email offline_accessstatestringOpaque value returned unchanged; strongly recommended against CSRF.
Example:af0ifjsldkjcode_challengestringBASE64URL(SHA256(code_verifier)). Required for public clients.
min length 43max length 128Example:E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cMcode_challenge_methodstringSend
S256. If omitted, the challenge is treated asplainand an S256 verifier will fail at/oauth/token.One ofS256Example:S256noncestringOpenID Connect nonce, max 255 characters. Returned unchanged in the
nonceclaim of the ID token; check it there to bind the ID token to your sign-in request. A longer value is ignored without an error, and the ID token then has nononce.max length 255Example:n-0S6_WzA2Mjorg_idintegerCompany id (
orgs[].idinuserinfo) the token should start in. Used only if the person belongs to that company and its access rules let them in; otherwise ignored without an error. It ends up in theorg_idclaim of the access token and ofuserinfo, is kept by every refresh, and the MCP connector uses it as the active company (active_company_source: claim). It is a hint, not a restriction: the token still works in every company of the person.Example:7promptstringloginforces a new sign-in,consentforces the consent screen,nonefails withlogin_required/consent_requiredinstead of showing UI.One ofnoneloginconsentExample:login
Responses
200Sign-in page or consent screen (HTML).text/html
string
302Redirect. Either to
/login(no session), or back to the client:https://assistant.acme.example/oauth/callback?code=def502…&state=af0ifjsldkjon approval,…?error=access_denied&error_description=…&state=af0ifjsldkjon denial;error=<code>(e.g.invalid_scope) on an invalid request.HeadersLocation
curl -X GET 'https://auth.nucleoplatform.com/oauth/authorize?response_type=code&client_id=9d3f2b1c-6a4e-4f7b-9c2d-1e8a7b6c5d4f&redirect_uri=https%3A%2F%2Fassistant.acme.example%2Foauth%2Fcallback&scope=openid%20profile%20email%20offline_access&state=af0ifjsldkj&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&nonce=n-0S6_WzA2Mj&org_id=7&prompt=login' \
-H 'Accept: text/html'const res = await fetch("https://auth.nucleoplatform.com/oauth/authorize?response_type=code&client_id=9d3f2b1c-6a4e-4f7b-9c2d-1e8a7b6c5d4f&redirect_uri=https%3A%2F%2Fassistant.acme.example%2Foauth%2Fcallback&scope=openid%20profile%20email%20offline_access&state=af0ifjsldkj&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&nonce=n-0S6_WzA2Mj&org_id=7&prompt=login", {
method: "GET",
headers: {
Accept: "text/html",
},
});
const data = await res.text();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://auth.nucleoplatform.com/oauth/authorize?response_type=code&client_id=9d3f2b1c-6a4e-4f7b-9c2d-1e8a7b6c5d4f&redirect_uri=https%3A%2F%2Fassistant.acme.example%2Foauth%2Fcallback&scope=openid%20profile%20email%20offline_access&state=af0ifjsldkj&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&nonce=n-0S6_WzA2Mj&org_id=7&prompt=login', [
'headers' => [
'Accept' => 'text/html',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();string