|
1 | 1 | /** |
2 | | - * ABOUT: |
3 | | - * |
4 | 2 | * The bare minimum example for using user authentication with custom UID and claims. |
5 | 3 | * |
6 | 4 | * This example requires the service account credentials that obtains from the JSON key file. |
7 | 5 | * |
8 | 6 | * The complete usage guidelines, please read README.md or visit https://github.com/mobizt/FirebaseClient |
9 | | - * |
10 | | - * SYNTAX: |
11 | | - * |
12 | | - * 1.------------------------ |
13 | | - * |
14 | | - * CustomAuth::CustomAuth(<api_key>, <client_email>, <project_id>, <private_key>, <user_id>, <scope>, <claims>, <expire>); |
15 | | - * |
16 | | - * <api_key> - The web API key of project. |
17 | | - * <client_email> - The service account client Email. |
18 | | - * <project_id> - The service account project ID. |
19 | | - * <private_key> - The service account private key. |
20 | | - * <user_id> - The unique identifier of the signed-in user must be a string, between 1-128 characters long, inclusive. Shorter uids offer better performance. |
21 | | - * <claims> - Optional custom claims to include in the Security Rules auth / request.auth variables. |
22 | | - * <expire> - The expiry period in seconds (less than 3600), 3300 is the default value. |
23 | | - * |
24 | | - * 2.------------------------ |
25 | | - * |
26 | | - * CustomAuth::CustomAuth(<TimeStatusCallback>, <api_key>, <client_email>, <project_id>, <private_key>, <user_id>, <scope>, <claims>, <expire>); |
27 | | - * |
28 | | - * <TimeStatusCallback> - The time status callback that provide the UNIX timestamp value used for JWT token signing. |
29 | | - * <api_key> - The web API key of project. |
30 | | - * <client_email> - The service account client Email. |
31 | | - * <project_id> - The service account project ID. |
32 | | - * <private_key> - The service account private key. |
33 | | - * <user_id> - The user ID. |
34 | | - * <scope> - The OAuth scopes. |
35 | | - * <claims> - The OAuth claims. For more details about claims, please visit https://firebase.google.com/docs/auth/admin/custom-claims. |
36 | | - * <expire> - The expiry period in seconds (less than 3600), 3300 is the default value. |
37 | | - * |
38 | | - * See examples/RealtimeDatabase/AccessControl/AccessControl.ino for how it can work with security rules for database access control. |
39 | | - * |
40 | | - * 3.------------------------ |
41 | | - * |
42 | | - * initializeApp(<AsyncClient>, <FirebaseApp>, <user_auth_data>, <AsyncResultCallback>, <uid>); |
43 | | - * |
44 | | - * <AsyncClient> - The async client. |
45 | | - * <FirebaseApp> - The authentication and access token handler. |
46 | | - * <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token. |
47 | | - * |
48 | | - * The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e. |
49 | | - * CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken. |
50 | | - * |
51 | | - * <AsyncResultCallback> - The AsyncResultCallback function for debugging. |
52 | | - * <uid> - Optional The user defined task UID for debugging. |
53 | | - * |
54 | | - * 4.------------------------ |
55 | | - * |
56 | | - * initializeApp(<AsyncClient>, <FirebaseApp>, <user_auth_data>, <timeoutMs>, <AsyncResultCallback>); |
57 | | - * |
58 | | - * <AsyncClient> - The async client. |
59 | | - * <FirebaseApp> - The authentication and access token handler. |
60 | | - * <user_auth_data> - The user auth data (user_auth_data struct) that holds the user input sign-in credentials and token. |
61 | | - * |
62 | | - * The <user_auth_data> can be obtained from the following sign-in credentials, access key, auth token providers classs via getAuth function i.e. |
63 | | - * CustomAuth, ServiceAuth, UserAuth, NoAuth, CustomToken, AccessToken, IDToken, LegacyToken. |
64 | | - * |
65 | | - * <timeoutMs> - Optional. The await timeout in milliseconds. |
66 | | - * <AsyncResultCallback> - Optional. The async result callback (AsyncResultCallback) for debugging. |
67 | | - * |
68 | | - * NOTE: |
69 | | - * |
70 | | - * The valid time is required for private key signing process in JWT token generation. |
71 | | - * In case TimeStatusCallback was not assigned in the CustomAuth class constructor, |
72 | | - * use FirebaseApp::setTime before calling initializeApp. |
73 | | - * |
74 | | - * The timeoutMs is the timeout for waiting the authentication process to be done. |
75 | | - * |
76 | | - * By providing AsyncResultCallback in the initializeApp function, the debug information will be collected and send to AsyncResultCallback |
77 | | - * function immediately. |
78 | 7 | */ |
79 | 8 |
|
80 | | - |
81 | | -// To define build options in your sketch, |
82 | | -// adding the following macros before FirebaseClient.h |
83 | 9 | #define ENABLE_CUSTOM_AUTH |
84 | 10 |
|
85 | 11 | #include <FirebaseClient.h> |
|
0 commit comments