grant.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // oauth configuration for provider services that are used.
  2. module.exports = () => {
  3. return {
  4. // for drive
  5. google: {
  6. transport: 'session',
  7. scope: [
  8. 'https://www.googleapis.com/auth/drive.readonly',
  9. ],
  10. callback: '/drive/callback',
  11. // access_type: offline is needed in order to get refresh tokens.
  12. // prompt: 'consent' is needed because sometimes a user will get stuck in an authenticated state where we will
  13. // receive no refresh tokens from them. This seems to be happen when running on different subdomains.
  14. // therefore to be safe that we always get refresh tokens, we set this.
  15. // https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token/65108513#65108513
  16. custom_params: { access_type : 'offline', prompt: 'consent' },
  17. },
  18. dropbox: {
  19. transport: 'session',
  20. authorize_url: 'https://www.dropbox.com/oauth2/authorize',
  21. access_url: 'https://api.dropbox.com/oauth2/token',
  22. callback: '/dropbox/callback',
  23. custom_params: { token_access_type : 'offline' },
  24. },
  25. box: {
  26. transport: 'session',
  27. authorize_url: 'https://account.box.com/api/oauth2/authorize',
  28. access_url: 'https://api.box.com/oauth2/token',
  29. callback: '/box/callback',
  30. },
  31. instagram: {
  32. transport: 'session',
  33. callback: '/instagram/callback',
  34. },
  35. facebook: {
  36. transport: 'session',
  37. scope: ['email', 'user_photos'],
  38. callback: '/facebook/callback',
  39. },
  40. // for onedrive
  41. microsoft: {
  42. transport: 'session',
  43. scope: ['files.read.all', 'offline_access', 'User.Read'],
  44. callback: '/onedrive/callback',
  45. },
  46. zoom: {
  47. transport: 'session',
  48. authorize_url: 'https://zoom.us/oauth/authorize',
  49. access_url: 'https://zoom.us/oauth/token',
  50. callback: '/zoom/callback',
  51. },
  52. }
  53. }