@@ -312,6 +312,85 @@ paths:
312312 'https://localhost:9443/t/<tenant_domain>/o/api/users/v1/user-id/federated-associations/federated-association-id' \
313313 -H 'accept: */*' \
314314 -H 'Authorization: Bearer <token>'
315+ /federated-associations/bulk :
316+ post :
317+ tags :
318+ - admin
319+ summary : Create and Delete users associations in bulk
320+ description : |
321+ This API is used to create and delete users association in bulk. <br>
322+ Maximum number of supported operations in a single request is 1000 by default.
323+ It can be configured using a server level configuration.
324+ <b>Scope required:</b>
325+ * internal_user_fed_association_bulk
326+ parameters :
327+ - name : body
328+ in : body
329+ required : false
330+ schema :
331+ $ref : ' #/definitions/BulkFederatedAssociationRequest'
332+ responses :
333+ 200 :
334+ description : Success
335+ schema :
336+ $ref : ' #/definitions/BulkFederatedAssociationResponse'
337+ 400 :
338+ description : Bad Request
339+ schema :
340+ $ref : ' #/definitions/Error'
341+ 401 :
342+ description : Unauthorized
343+ schema :
344+ $ref : ' #/definitions/Error'
345+ 403 :
346+ description : Forbidden
347+ schema :
348+ $ref : ' #/definitions/Error'
349+ 500 :
350+ description : Internal Server Error
351+ schema :
352+ $ref : ' #/definitions/Error'
353+ x-codeSamples :
354+ - lang : Curl
355+ source : |
356+ curl -X 'POST' \
357+ 'https://localhost:9443/api/users/v1/federated-associations/bulk' \
358+ -H 'accept: */*' \
359+ -H 'Authorization: Bearer {bearer-token}' \
360+ -d '{
361+ "failOnErrors": 0,
362+ "operations": [
363+ {
364+ "method": "POST",
365+ "bulkId": "qewvaewv",
366+ "path": "/1ca49238-3ab0-474b-9d42-8067780a503c/federated-associations",
367+ "data": {
368+ "idp": "Google",
369+ "federatedUserId": "sam@gmail,com"
370+ }
371+ },
372+ {
373+ "method": "POST",
374+ "bulkId": "fgnruyt",
375+ "path": "/7589bffc-b315-4dbd-83a5-86f5b8aa4776/federated-associations",
376+ "data": {
377+ "idp": "Google",
378+ "federatedUserId": "mike@gmail,com"
379+ }
380+ },
381+ {
382+ "method": "DELETE",
383+ "bulkId": "useffger",
384+ "path": "/0a2d94e2-3b98-49ea-89d6-e8dd9e0ff89b/federated-associations"
385+ },
386+ {
387+ "method": "DELETE",
388+ "bulkId": "eefvrtgnrtn",
389+ "path": "/197fc0fa-c2b0-48e6-92a6-a551afc3d125/federated-associations/0dcc3f5a-3bee-4f36-a91f-8ee60dbae875"
390+ }
391+ ]
392+ }'
393+
315394components :
316395 schemas :
317396 Error :
@@ -415,6 +494,91 @@ components:
415494 type : string
416495417496 description : User identifier in the federated IdP
497+ BulkFederatedAssociationRequest :
498+ type : object
499+ properties :
500+ failOnErrors :
501+ type : integer
502+ example : 1
503+ description : |
504+ This represents whether the API should stop processing the operations if any of them fail. The subsequent
505+ operations after the the fail count is reached will not be processed.
506+ If set to 0 or not set, the API will continue processing the operations even if some of them fail.
507+ operations :
508+ type : array
509+ items :
510+ $ref : ' #/definitions/BulkFederatedAssociationOperation'
511+
512+ BulkFederatedAssociationOperation :
513+ type : object
514+ required :
515+ - method
516+ - bulkId
517+ - path
518+ properties :
519+ method :
520+ type : string
521+ enum :
522+ - POST
523+ - DELETE
524+ example : POST
525+ description : |
526+ HTTP method to be used for the operation. Supported methods are POST and, DELETE. These values
527+ If the method is not specified, the operation will be treated as a bad request.
528+ bulkId :
529+ type : string
530+ example : " ytrewq"
531+ path :
532+ type : string
533+ example : " /b1781d25-bde5-460a-a58a-8fe8dbfd8487/federated-associations"
534+ description : |
535+ The path to the resource to be operated on. The path should be relative to the base path of the API.
536+ Full path for a federated association operation would be
537+ `/t/{tenant-domain}/api/users/v1/{user-id}/federated-associations/{association-id}`.
538+ data :
539+ $ref : ' #/definitions/UserFederatedAssociationData'
540+
541+ UserFederatedAssociationData :
542+ type : object
543+ properties :
544+ idp :
545+ type : string
546+ example : " exampleIdP"
547+ description : Name of the IdP
548+ federatedUserId :
549+ type : string
550+ 551+ description : User identifier in the federated IdP
552+
553+ BulkFederatedAssociationResponse :
554+ type : object
555+ properties :
556+ Operations :
557+ type : array
558+ items :
559+ $ref : ' #/definitions/BulkAssociationOperationResponse'
560+
561+ BulkAssociationOperationResponse :
562+ type : object
563+ properties :
564+ bulkId :
565+ type : string
566+ example : " qwerty"
567+ status :
568+ type : object
569+ properties :
570+ statusCode :
571+ type : integer
572+ example : " 400"
573+ errorCode :
574+ type : string
575+ example : " UAA-10012"
576+ errorMessage :
577+ type : string
578+ example : " Error while adding federated user association: 1890c6c0-d1a0-4eb4-8075-320756d75946"
579+ errorDescription :
580+ type : string
581+ example : " The federated association is already associated to a local user"
418582 securitySchemes :
419583 OAuth2 :
420584 type : oauth2
0 commit comments