@react-native-firebase/auth 16.5.2 → 16.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [16.7.0](https://github.com/invertase/react-native-firebase/compare/v16.6.0...v16.7.0) (2023-01-28)
7
+
8
+ **Note:** Version bump only for package @react-native-firebase/auth
9
+
10
+ ## [16.6.0](https://github.com/invertase/react-native-firebase/compare/v16.5.2...v16.6.0) (2023-01-27)
11
+
12
+ ### Features
13
+
14
+ - **auth:** Add support for OpenID Connect provider ([#6574](https://github.com/invertase/react-native-firebase/issues/6574)) ([469bf00](https://github.com/invertase/react-native-firebase/commit/469bf004c8d4ccf3da46215e7ca7562a6739265d))
15
+
6
16
  ### [16.5.2](https://github.com/invertase/react-native-firebase/compare/v16.5.1...v16.5.2) (2023-01-23)
7
17
 
8
18
  ### Bug Fixes
@@ -1554,6 +1554,10 @@ class ReactNativeFirebaseAuthModule extends ReactNativeFirebaseModule {
1554
1554
  /** Returns an instance of AuthCredential for the specified provider */
1555
1555
  private AuthCredential getCredentialForProvider(
1556
1556
  String provider, String authToken, String authSecret) {
1557
+ if (provider.startsWith("oidc.")) {
1558
+ return OAuthProvider.newCredentialBuilder(provider).setIdToken(authToken).build();
1559
+ }
1560
+
1557
1561
  switch (provider) {
1558
1562
  case "facebook.com":
1559
1563
  return FacebookAuthProvider.getCredential(authToken);
@@ -1126,6 +1126,10 @@ RCT_EXPORT_METHOD(useEmulator
1126
1126
  credential = [FIROAuthProvider credentialWithProviderID:@"oauth"
1127
1127
  IDToken:authToken
1128
1128
  accessToken:authTokenSecret];
1129
+ } else if ([provider hasPrefix:@"oidc."]) {
1130
+ credential = [FIROAuthProvider credentialWithProviderID:provider
1131
+ IDToken:authToken
1132
+ rawNonce:nil];
1129
1133
  } else {
1130
1134
  DLog(@"Provider not yet handled: %@", provider);
1131
1135
  }
package/lib/index.js CHANGED
@@ -34,6 +34,7 @@ import FacebookAuthProvider from './providers/FacebookAuthProvider';
34
34
  import GithubAuthProvider from './providers/GithubAuthProvider';
35
35
  import GoogleAuthProvider from './providers/GoogleAuthProvider';
36
36
  import OAuthProvider from './providers/OAuthProvider';
37
+ import OIDCAuthProvider from './providers/OIDCAuthProvider';
37
38
  import PhoneAuthProvider from './providers/PhoneAuthProvider';
38
39
  import PhoneMultiFactorGenerator from './PhoneMultiFactorGenerator';
39
40
  import TwitterAuthProvider from './providers/TwitterAuthProvider';
@@ -54,6 +55,7 @@ const statics = {
54
55
  FacebookAuthProvider,
55
56
  PhoneMultiFactorGenerator,
56
57
  OAuthProvider,
58
+ OIDCAuthProvider,
57
59
  PhoneAuthState: {
58
60
  CODE_SENT: 'sent',
59
61
  AUTO_VERIFY_TIMEOUT: 'timeout',
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library 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
+
18
+ const providerId = 'oidc.';
19
+
20
+ export default class OIDCAuthProvider {
21
+ constructor() {
22
+ throw new Error('`new OIDCAuthProvider()` is not supported on the native Firebase SDKs.');
23
+ }
24
+
25
+ static get PROVIDER_ID() {
26
+ return providerId;
27
+ }
28
+
29
+ static credential(oidcSuffix, idToken, accessToken) {
30
+ return {
31
+ token: idToken,
32
+ secret: accessToken,
33
+ providerId: providerId + oidcSuffix,
34
+ };
35
+ }
36
+ }
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '16.5.2';
2
+ module.exports = '16.7.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/auth",
3
- "version": "16.5.2",
3
+ "version": "16.7.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - The authentication module provides an easy-to-use API to integrate an authentication workflow into new and existing applications. React Native Firebase provides access to all Firebase authentication methods and identity providers.",
6
6
  "main": "lib/index.js",
@@ -28,7 +28,7 @@
28
28
  "plist": "^3.0.5"
29
29
  },
30
30
  "peerDependencies": {
31
- "@react-native-firebase/app": "16.5.2"
31
+ "@react-native-firebase/app": "16.7.0"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
@@ -36,5 +36,5 @@
36
36
  "devDependencies": {
37
37
  "@types/plist": "^3.0.2"
38
38
  },
39
- "gitHead": "97a5523bac4570ba7b47fbfdbb22348f38246d11"
39
+ "gitHead": "a94f371da16f9bf873c18b09541cbeb19960978d"
40
40
  }