@@ -341,7 +341,11 @@ public protocol Authentication: SenderConstraining, Trackable, Loggable {
341341
342342 - [Authentication API Endpoint](https://auth0.com/docs/api/authentication/token-exchange-for-native-social/token-exchange-native-social)
343343 */
344- func login( appleAuthorizationCode authorizationCode: String , fullName: PersonNameComponents ? , profile: [ String : Any ] ? , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError >
344+ func login( appleAuthorizationCode authorizationCode: String ,
345+ fullName: PersonNameComponents ? ,
346+ profile: [ String : Any ] ? ,
347+ audience: String ? ,
348+ scope: String ) -> Request < Credentials , AuthenticationError >
345349
346350 /**
347351 Logs a user in with their Facebook [session info access token](https://developers.facebook.com/docs/facebook-login/access-tokens/session-info-access-token/) and profile data.
@@ -386,7 +390,10 @@ public protocol Authentication: SenderConstraining, Trackable, Loggable {
386390
387391 - [Authentication API Endpoint](https://auth0.com/docs/api/authentication/token-exchange-for-native-social/token-exchange-native-social)
388392 */
389- func login( facebookSessionAccessToken sessionAccessToken: String , profile: [ String : Any ] , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError >
393+ func login( facebookSessionAccessToken sessionAccessToken: String ,
394+ profile: [ String : Any ] ,
395+ audience: String ? ,
396+ scope: String ) -> Request < Credentials , AuthenticationError >
390397
391398 /**
392399 Logs a user in using a username and password in the default directory.
@@ -1113,7 +1120,7 @@ public protocol Authentication: SenderConstraining, Trackable, Loggable {
11131120 }
11141121 ```
11151122
1116- You can also include additional parameters :
1123+ You can also include organization parameter :
11171124
11181125 ```swift
11191126 Auth0
@@ -1122,7 +1129,7 @@ public protocol Authentication: SenderConstraining, Trackable, Loggable {
11221129 subjectTokenType: "urn:ietf:params:oauth:token-type:jwt",
11231130 audience: "https://example.com/api",
11241131 scope: "openid profile email",
1125- additionalParameters: ["custom_claim": "value"] )
1132+ organization: "org_id" )
11261133 .start { print($0) }
11271134 ```
11281135
@@ -1131,17 +1138,20 @@ public protocol Authentication: SenderConstraining, Trackable, Loggable {
11311138 - subjectTokenType: URI that identifies the type of the subject token.
11321139 - audience: API Identifier that your application is requesting access to. Defaults to `nil`.
11331140 - scope: Space-separated list of requested scope values. Defaults to `openid profile email`.
1134- - additionalParameters: Additional parameters to include in the token exchange request. Defaults to empty dictionary .
1141+ - organization: Identifier of an organization the user is a member of .
11351142 - Returns: A request that will yield Auth0 user's credentials.
1136-
1143+
11371144 ## See Also
11381145
11391146 - [Authentication API Endpoint](https://auth0.com/docs/api/authentication/token-exchange)
11401147 - [Custom Token Exchange Documentation](https://auth0.com/docs/authenticate/custom-token-exchange)
11411148 - [RFC 8693: OAuth 2.0 Token Exchange](https://tools.ietf.org/html/rfc8693)
11421149 */
1143- func customTokenExchange( subjectToken: String , subjectTokenType: String , audience: String ? , scope: String ) -> Request < Credentials , AuthenticationError >
1144-
1150+ func customTokenExchange( subjectToken: String ,
1151+ subjectTokenType: String ,
1152+ audience: String ? ,
1153+ scope: String ,
1154+ organization: String ? ) -> Request < Credentials , AuthenticationError >
11451155}
11461156
11471157public extension Authentication {
@@ -1166,12 +1176,26 @@ public extension Authentication {
11661176 return self . multifactorChallenge ( mfaToken: mfaToken, types: types, authenticatorId: authenticatorId)
11671177 }
11681178
1169- func login( appleAuthorizationCode authorizationCode: String , fullName: PersonNameComponents ? = nil , profile: [ String : Any ] ? = nil , audience: String ? = nil , scope: String = defaultScope) -> Request < Credentials , AuthenticationError > {
1170- return self . login ( appleAuthorizationCode: authorizationCode, fullName: fullName, profile: profile, audience: audience, scope: scope)
1179+ func login( appleAuthorizationCode authorizationCode: String ,
1180+ fullName: PersonNameComponents ? = nil ,
1181+ profile: [ String : Any ] ? = nil ,
1182+ audience: String ? = nil ,
1183+ scope: String = defaultScope) -> Request < Credentials , AuthenticationError > {
1184+ return self . login ( appleAuthorizationCode: authorizationCode,
1185+ fullName: fullName,
1186+ profile: profile,
1187+ audience: audience,
1188+ scope: scope)
11711189 }
11721190
1173- func login( facebookSessionAccessToken sessionAccessToken: String , profile: [ String : Any ] , audience: String ? = nil , scope: String = defaultScope) -> Request < Credentials , AuthenticationError > {
1174- return self . login ( facebookSessionAccessToken: sessionAccessToken, profile: profile, audience: audience, scope: scope)
1191+ func login( facebookSessionAccessToken sessionAccessToken: String ,
1192+ profile: [ String : Any ] ,
1193+ audience: String ? = nil ,
1194+ scope: String = defaultScope) -> Request < Credentials , AuthenticationError > {
1195+ return self . login ( facebookSessionAccessToken: sessionAccessToken,
1196+ profile: profile,
1197+ audience: audience,
1198+ scope: scope)
11751199 }
11761200
11771201 func loginDefaultDirectory( withUsername username: String , password: String , audience: String ? = nil , scope: String = defaultScope) -> Request < Credentials , AuthenticationError > {
@@ -1251,8 +1275,16 @@ public extension Authentication {
12511275 return self . renew ( withRefreshToken: refreshToken, audience: audience, scope: scope)
12521276 }
12531277
1254- func customTokenExchange( subjectToken: String , subjectTokenType: String , audience: String ? = nil , scope: String = defaultScope) -> Request < Credentials , AuthenticationError > {
1255- return self . customTokenExchange ( subjectToken: subjectToken, subjectTokenType: subjectTokenType, audience: audience, scope: scope)
1278+ func customTokenExchange( subjectToken: String ,
1279+ subjectTokenType: String ,
1280+ audience: String ? = nil ,
1281+ scope: String = defaultScope,
1282+ organization: String ? = nil ) -> Request < Credentials , AuthenticationError > {
1283+ return self . customTokenExchange ( subjectToken: subjectToken,
1284+ subjectTokenType: subjectTokenType,
1285+ audience: audience,
1286+ scope: scope,
1287+ organization: organization)
12561288 }
12571289
12581290}
0 commit comments