@@ -91,33 +91,104 @@ import Foundation
9191 /// - Parameter accessToken: The access token associated with the Auth credential be created, if
9292 /// available.
9393 /// - Returns: An AuthCredential for the specified provider ID, ID token and access token.
94+ @available ( swift, introduced: 100.0 )
9495 @objc ( credentialWithProviderID: IDToken: accessToken: )
96+ public static func credential( withProviderID providerID: NSString ,
97+ idToken: NSString ,
98+ accessToken: NSString ? ) -> OAuthCredential {
99+ return OAuthCredential (
100+ withProviderID: providerID as String ,
101+ idToken: idToken as String ,
102+ accessToken: accessToken as String ?
103+ )
104+ }
105+
106+ @available (
107+ * ,
108+ deprecated,
109+ message: " Use `credential(providerID: AuthProviderID, idToken: String, accessToken: String) -> OAuthCredential` instead. "
110+ )
95111 public static func credential( withProviderID providerID: String ,
96112 idToken: String ,
97113 accessToken: String ? ) -> OAuthCredential {
98114 return OAuthCredential ( withProviderID: providerID, idToken: idToken, accessToken: accessToken)
99115 }
100116
117+ /// Creates an `AuthCredential` for the OAuth 2 provider identified by provider ID, ID
118+ /// token, and access token.
119+ /// - Parameter providerID: The provider ID associated with the Auth credential being created.
120+ /// - Parameter idToken: The IDToken associated with the Auth credential being created.
121+ /// - Parameter accessToken: The access token associated with the Auth credential be created, if
122+ /// available.
123+ /// - Returns: An AuthCredential for the specified provider ID, ID token and access token.
124+ public static func credential( providerID: AuthProviderID ,
125+ idToken: String ,
126+ accessToken: String ? ) -> OAuthCredential {
127+ return OAuthCredential (
128+ withProviderID: providerID. rawValue,
129+ idToken: idToken,
130+ accessToken: accessToken
131+ )
132+ }
133+
134+ /// Creates an `AuthCredential` for the OAuth 2 provider identified by provider ID, ID
135+ /// token, and access token.
136+ /// - Parameter providerID: The provider ID associated with the Auth credential being created.
137+ /// - Parameter accessToken: The access token associated with the Auth credential be created, if
138+ /// available.
139+ /// - Returns: An AuthCredential for the specified provider ID, ID token and access token.
140+ @available ( swift, introduced: 100.0 )
141+ @objc ( credentialWithProviderID: accessToken: )
142+ public static func credential( withProviderID providerID: NSString ,
143+ accessToken: NSString ) -> OAuthCredential {
144+ return OAuthCredential ( withProviderID: providerID as String , accessToken: accessToken as String )
145+ }
146+
147+ @available (
148+ * ,
149+ deprecated,
150+ message: " Use `credential(providerID: AuthProviderID, accessToken: String) -> OAuthCredential` instead. "
151+ )
152+ public static func credential( withProviderID providerID: String ,
153+ accessToken: String ) -> OAuthCredential {
154+ return OAuthCredential ( withProviderID: providerID, accessToken: accessToken)
155+ }
156+
101157 /// Creates an `AuthCredential` for the OAuth 2 provider identified by provider ID using
102158 /// an ID token.
103159 /// - Parameter providerID: The provider ID associated with the Auth credential being created.
104160 /// - Parameter accessToken: The access token associated with the Auth credential be created
105161 /// - Returns: An AuthCredential.
106- @objc ( credentialWithProviderID: accessToken: )
107- public static func credential( withProviderID providerID: String ,
162+ public static func credential( providerID: AuthProviderID ,
108163 accessToken: String ) -> OAuthCredential {
109- return OAuthCredential ( withProviderID: providerID, accessToken: accessToken)
164+ return OAuthCredential ( withProviderID: providerID. rawValue , accessToken: accessToken)
110165 }
111166
112167 /// Creates an `AuthCredential` for that OAuth 2 provider identified by provider ID, ID
113168 /// token, raw nonce, and access token.
114169 /// - Parameter providerID: The provider ID associated with the Auth credential being created.
115170 /// - Parameter idToken: The IDToken associated with the Auth credential being created.
116171 /// - Parameter rawNonce: The raw nonce associated with the Auth credential being created.
117- /// - Parameter accessToken: The access token associated with the Auth credential be created, if
118- /// available.
172+ /// - Parameter accessToken: The access token associated with the Auth credential be created.
119173 /// - Returns: An AuthCredential for the specified provider ID, ID token and access token.
174+ @available ( swift, introduced: 100.0 )
120175 @objc ( credentialWithProviderID: IDToken: rawNonce: accessToken: )
176+ public static func credential( withProviderID providerID: NSString , idToken: NSString ,
177+ rawNonce: NSString ,
178+ accessToken: NSString ) -> OAuthCredential {
179+ return OAuthCredential (
180+ withProviderID: providerID as String ,
181+ idToken: idToken as String ,
182+ rawNonce: rawNonce as String ,
183+ accessToken: accessToken as String
184+ )
185+ }
186+
187+ @available (
188+ * ,
189+ deprecated,
190+ message: " Use `credential(providerID: AuthProviderID, rawNonce: String, accessToken: String) -> OAuthCredential` instead. "
191+ )
121192 public static func credential( withProviderID providerID: String , idToken: String ,
122193 rawNonce: String ,
123194 accessToken: String ) -> OAuthCredential {
@@ -135,12 +206,46 @@ import Foundation
135206 /// - Parameter idToken: The IDToken associated with the Auth credential being created.
136207 /// - Parameter rawNonce: The raw nonce associated with the Auth credential being created.
137208 /// - Returns: An AuthCredential.
209+ @available ( swift, introduced: 100.0 )
138210 @objc ( credentialWithProviderID: IDToken: rawNonce: )
211+ public static func credential( withProviderID providerID: NSString , idToken: NSString ,
212+ rawNonce: NSString ) -> OAuthCredential {
213+ return OAuthCredential (
214+ withProviderID: providerID as String ,
215+ idToken: idToken as String ,
216+ rawNonce: rawNonce as String
217+ )
218+ }
219+
220+ @available (
221+ * ,
222+ deprecated,
223+ message: " Use `credential(providerID: AuthProviderID, idToken: String, rawNonce: String) -> OAuthCredential` instead. "
224+ )
139225 public static func credential( withProviderID providerID: String , idToken: String ,
140226 rawNonce: String ) -> OAuthCredential {
141227 return OAuthCredential ( withProviderID: providerID, idToken: idToken, rawNonce: rawNonce)
142228 }
143229
230+ /// Creates an `AuthCredential` for that OAuth 2 provider identified by provider ID, ID
231+ /// token, raw nonce, and access token.
232+ /// - Parameter providerID: The provider ID associated with the Auth credential being created.
233+ /// - Parameter idToken: The IDToken associated with the Auth credential being created.
234+ /// - Parameter rawNonce: The raw nonce associated with the Auth credential being created.
235+ /// - Parameter accessToken: The access token associated with the Auth credential be created, if
236+ /// available.
237+ /// - Returns: An AuthCredential for the specified provider ID, ID token and access token.
238+ public static func credential( providerID: AuthProviderID , idToken: String ,
239+ rawNonce: String ,
240+ accessToken: String ? = nil ) -> OAuthCredential {
241+ return OAuthCredential (
242+ withProviderID: providerID. rawValue,
243+ idToken: idToken,
244+ rawNonce: rawNonce,
245+ accessToken: accessToken
246+ )
247+ }
248+
144249 #if os(iOS)
145250 /// Used to obtain an auth credential via a mobile web flow.
146251 ///
0 commit comments