Skip to content

Commit

Permalink
fix: Use readonly OAuth scope in the AI Knowledge Assistant app
Browse files Browse the repository at this point in the history
The AI Knowledge Assistant uses the Chat API with user credentials to list the messages in a space. It only needs the scope chat.messages.readonly to list the messages; it doesn't need a scope with write permission.
  • Loading branch information
gtondello committed Apr 23, 2024
1 parent 812786d commit f8f55e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node/ai-knowledge-assistant/services/user-auth.js
Expand Up @@ -29,7 +29,7 @@ const { FirestoreService } = require('./firestore-service');
const keys = require('../client_secrets.json').web;

// Define the app's authorization scopes.
const scopes = ['https://www.googleapis.com/auth/chat.messages'];
const scopes = ['https://www.googleapis.com/auth/chat.messages.readonly'];

/**
* Creates a new OAuth2 client with the configured keys.
Expand Down

0 comments on commit f8f55e8

Please sign in to comment.