Skip to content

Conversation

priley86
Copy link

@priley86 priley86 commented Oct 2, 2025

Updates all examples with latest auth0-ai python and auth0-ai-js packages.

note: currently awaiting release/publish of these package updates being made in:
auth0-lab/auth0-ai-python#51
auth0-lab/auth0-ai-js#285

Planning to update all packages after release, but going ahead w/ review requests.

cc: @pmalouin

@priley86 priley86 force-pushed the auth0-ai-sdk-updates branch from 5fcf940 to fff1044 Compare October 2, 2025 20:51
Comment on lines +93 to 95
"resolutions": {
"@auth0/ai": "file:auth0-ai-0.0.0.tgz"
}
Copy link
Author

@priley86 priley86 Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to myself to:

  • remove the @auth0/ai package reference after release/publish of those packages
  • remove the resolutions reference
  • (and upgrade the @auth0/ai-langchain refernce)

These are temporary while testing w/ the local pnpm packages to test that nested dependency.

@@ -1,34 +1,148 @@
import { type Message } from "@langchain/langgraph-sdk";
import { type Message, type AIMessage } from '@langchain/langgraph-sdk';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added similar chat message bubble / tool call display that we've added recently in:
auth0-samples/auth0-ai-samples#7

see changes here and in chat-window.tsx.

Comment on lines +18 to +34
export const withGoogleConnection = auth0AICustomAPI.withTokenVault({
connection: 'google-oauth2',
scopes: [
'https://www.googleapis.com/auth/gmail.readonly',
'https://www.googleapis.com/auth/gmail.compose',
'https://www.googleapis.com/auth/calendar.events',
],
accessToken: async (_, config) => {
return config.configurable?.langgraph_auth_user?.getRawAccessToken();
},
subjectTokenType: SUBJECT_TOKEN_TYPES.SUBJECT_TYPE_ACCESS_TOKEN,
});

// CIBA flow for user confirmation
export const withAsyncAuthorization = auth0AI.withAsyncUserConfirmation({
// Async Authorization flow for user confirmation
// Note: you must use a client application that has the CIBA grant type enabled
// in this case, we can use auth0 regular web app client
const auth0AI = new Auth0AI();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to use separate clients here in this example (authAI vs auth0AICustomAPI), b/c the Resource Server Client/Custom API Client currently does not support CIBA grant types.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per discussion today, we can expect that Custom API Client should support CIBA in the future, but opting to use the Regular Web App client's credentials for now (so we do not need to introduce another client w/ this example). In the long run, we should be able to simply use the same Custom API Client.

},
bindingMessage: async ({ product, qty }) => `Do you want to buy ${qty} ${product}`,
scopes: ['openid', 'product:buy'],
scopes: ['openid', 'buy:product'],
Copy link
Author

@priley86 priley86 Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wanted to call out that, regarding the scope conventions used in these examples, the default consent screen currently renders "{noun}: {verb} your {noun}" with respect to the scope used. So you can't really change this at the moment unless you use a custom prompt template. We do also allow custom scope descriptions though, but this is an additional setting, and prefer to use this sort of convention moving forward w/ the scope names by default "{verb}:{noun}".

https://auth0.com/docs/customize/login-pages/customize-consent-prompts

Screenshot 2025-10-06 at 12 30 00 PM

@priley86 priley86 marked this pull request as ready for review October 7, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant