MCPcopy
hub / github.com/FlowiseAI/Flowise / refreshToken

Method refreshToken

packages/server/src/enterprise/sso/Auth0SSO.ts:168–195  ·  view source on GitHub ↗
(ssoRefreshToken: string)

Source from the content-addressed store, hash-verified

166 }
167
168 async refreshToken(ssoRefreshToken: string) {
169 const { domain, clientID, clientSecret } = this.ssoConfig
170
171 const validatedDomain = validateAuth0Domain(domain)
172 if (!validatedDomain) {
173 const errorMessage = 'Auth0 Configuration test failed. Invalid Auth0 domain.'
174 return { error: errorMessage }
175 }
176
177 try {
178 const response = await axios.post(
179 `https://${validatedDomain}/oauth/token`,
180 {
181 client_id: clientID,
182 client_secret: clientSecret,
183 grant_type: 'refresh_token',
184 refresh_token: ssoRefreshToken
185 },
186 {
187 headers: { 'Content-Type': 'application/json' }
188 }
189 )
190 return { ...response.data }
191 } catch (error) {
192 const errorMessage = 'Failed to get refreshToken from Auth0.'
193 return { error: errorMessage }
194 }
195 }
196}
197
198export default Auth0SSO

Callers 1

getRefreshTokenMethod · 0.45

Calls 1

validateAuth0DomainFunction · 0.85

Tested by

no test coverage detected