AuthCredentialsTemplate.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. Some of the Auth Credentials needs to be populated for the ApiTests to work.
  18. Please follow the following steps to populate the valid AuthCredentials
  19. and copy it to AuthCredentials.h file
  20. You will need to replace the following values:
  21. $KGOOGLE_CLIENT_ID
  22. Get the value of the CLIENT_ID key in the GoogleService-Info.plist file.
  23. $KGOOGLE_TEST_ACCOUNT_REFRESH_TOKEN
  24. GOOGLE_TEST_ACCOUNT_REFRESH_TOKEN is the Google SignIn refresh token obtained
  25. for the Google client ID, saved for continuous tests. (Check out
  26. generate_refresh_token.sh for instructions on how to create a refresh token.)
  27. $KGOOGLE_USER_NAME
  28. The name of the test user for Google SignIn. e.g. "Fname Lname"
  29. $KFACEBOOK_APP_ID
  30. FACEBOOK_APP_ID is the developer's Facebook app's ID, to be used to test the
  31. 'Signing in with Facebook' feature of Firebase Auth. Follow the instructions
  32. on the Facebook developer site: https://developers.facebook.com/docs/apps/register
  33. to obtain such an id.
  34. $KFACEBOOK_APP_ACCESS_TOKEN
  35. Once you have a Facebook App Id, click on settings->basic from the dashboard of
  36. your app. You can see both your App ID and the App Secret. Once you have both
  37. of these, generate the access token using the instructions from
  38. https://developers.facebook.com/docs/facebook-login/access-tokens/#apptokens.
  39. tl;dr (remove the whitespace):
  40. curl -X GET "https://graph.facebook.com/oauth/access_token
  41. ?client_id=your-app-id
  42. &client_secret=your-app-secret
  43. &grant_type=client_credentials"
  44. $KFACEBOOK_USER_NAME
  45. The name of the test user for Facebook Login. A test user with this name will
  46. be created and deleted as part of these tests. e.g. "Fname Lname"
  47. $KCUSTOM_AUTH_TOKEN_URL
  48. A URL to return a Custom Auth token.
  49. $KCUSTOM_AUTH_TOKEN_EXPIRED_URL
  50. A URL to return an expired Custom Auth token.
  51. $KCUSTOM_AUTH_USER_ID
  52. The ID of the test user in the Custom Auth token.
  53. */
  54. #define KGOOGLE_CLIENT_ID $KGOOGLE_CLIENT_ID
  55. #define KGOOGLE_TEST_ACCOUNT_REFRESH_TOKEN $KGOOGLE_TEST_ACCOUNT_REFRESH_TOKEN
  56. #define KGOOGLE_USER_NAME $KGOOGLE_USER_NAME
  57. #define KFACEBOOK_APP_ID $KFACEBOOK_APP_ID
  58. #define KFACEBOOK_APP_ACCESS_TOKEN $KFACEBOOK_APP_ACCESS_TOKEN
  59. #define KFACEBOOK_USER_NAME KFACEBOOK_USER_NAME
  60. // The custom auth test is currently disabled. These values are ignored (though
  61. // must be present).
  62. #define KCUSTOM_AUTH_TOKEN_URL @"Disabled test"
  63. #define KCUSTOM_AUTH_TOKEN_EXPIRED_URL @"Disabled test"
  64. #define KCUSTOM_AUTH_USER_ID @"Disabled test"