You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verifies a Firebase ID token (JWT). If the token is valid, the promise is fulfilled with the token's decoded claims; otherwise, the promise is rejected.
117
+
118
+
See the [ID Token section of the OpenID Connect spec](http://openid.net/specs/openid-connect-core-1_0.html#IDToken) for more information about the specific properties below.
119
+
120
+
-`env` is an optional parameter. but this is using to detect should use emulator or not.
Returns the host of your Firebase Auth Emulator. For example, this case returns `"127.0.0.1:9099"` if you configured like below.
136
+
137
+
`wrangler.toml`
138
+
139
+
```toml
140
+
[vars]
141
+
FIREBASE_AUTH_EMULATOR_HOST = "127.0.0.1:9099"
142
+
```
143
+
144
+
### `useEmulator(env?: EmulatorEnv): boolean`
145
+
146
+
This is a wrapper `emulatorHost` function.
147
+
148
+
When true the SDK should communicate with the Auth Emulator for all API calls and also produce unsigned tokens.
149
+
150
+
## Type
151
+
152
+
### `KeyStorer`
153
+
154
+
This is an interface to cache the public key used to verify the Firebase ID token. By creating a class that implemented this interface, you can cache it in any storage of your choice.
Interface representing a decoded Firebase ID token, returned from the `authObj.verifyIdToken` method.
174
+
175
+
## Run example code
35
176
36
177
I put an [example](https://github.com/Code-Hex/firebase-auth-cloudflare-workers/tree/master/example) directory as Module Worker Syntax. this is explanation how to run the code.
37
178
@@ -42,4 +183,14 @@ I put an [example](https://github.com/Code-Hex/firebase-auth-cloudflare-workers/
42
183
5. Create a new user on Emulator UI. (email: `[email protected]` password: `test1234`)
43
184
6. Run example code on local (may serve as `localhost:8787`) by `$ yarn start-example`
44
185
7. Get jwt for created user by `$ curl -s http://localhost:8787/get-jwt | jq .idToken -r`
45
-
8. Try authorization with user jwt `$ curl http://localhost:8787/ -H 'Authorization: Bearer PASTE-JWT-HERE'`
186
+
8. Try authorization with user jwt `$ curl http://localhost:8787/ -H 'Authorization: Bearer PASTE-JWT-HERE'`
0 commit comments