File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
packages/mcp-server-utils/src Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -691,9 +691,13 @@ async function pollForToken(
691691/**
692692 * Returns the OAuth scopes we need for the issuer.
693693 *
694- * This will always include "openid profile" but some providers may need other
695- * scopes to make the user email available. We require the user email for the
696- * token to be valid.
694+ * In general this is "openid profile offline_access", but some providers may
695+ * require different scopes for idiosyncratic reasons.
696+ *
697+ * We require two things that are driven by scopes:
698+ *
699+ * - user email (openid profile)
700+ * - refresh tokens (offline_access)
697701 */
698702export function getOAuthScopes ( config : GleanOAuthConfig ) : string {
699703 const { issuer : issuer } = config ;
@@ -707,7 +711,7 @@ export function getOAuthScopes(config: GleanOAuthConfig): string {
707711 case 'okta.com' :
708712 return 'openid profile offline_access' ;
709713 default :
710- return 'openid profile' ;
714+ return 'openid profile offline_access ' ;
711715 }
712716}
713717
Original file line number Diff line number Diff line change @@ -658,7 +658,9 @@ describe('auth', () => {
658658 authType : 'oauth' as const ,
659659 baseUrl : 'https://api.example.com' ,
660660 } ;
661- expect ( getOAuthScopes ( config ) ) . toMatchInlineSnapshot ( `"openid profile"` ) ;
661+ expect ( getOAuthScopes ( config ) ) . toMatchInlineSnapshot (
662+ `"openid profile offline_access"` ,
663+ ) ;
662664 } ) ;
663665 } ) ;
664666
You can’t perform that action at this time.
0 commit comments