addLoginBridgeAllowedUsers()

The addLoginBridgeAllowedUsers() GraphQL mutation field is used to add a login bridge to a given organization.

Syntax

Below is the syntax for the addLoginBridgeAllowedUsers() mutation field:

graphql
addLoginBridgeAllowedUsers(
      userID: string!
    ): LoginBridge!

Below is an example of how this mutation field might be used:

Raw
graphql
mutation {
  addLoginBridgeAllowedUsers(userID: "DScDf7IpfDeykSYW1B7AU48p")
  {name, issuer, samlEntityId}
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\")
  {name, issuer, samlEntityId}
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\")
  {name, issuer, samlEntityId}
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\") ^
  {name, issuer, samlEntityId} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\")
  {name, issuer, samlEntityId}
}"
}'
"$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $INGEST_TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $json = '{"query" : "mutation {
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\")
  {name, issuer, samlEntityId}
}"
}';
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\")
  {name, issuer, samlEntityId}
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  addLoginBridgeAllowedUsers(userID: \"DScDf7IpfDeykSYW1B7AU48p\")
  {name, issuer, samlEntityId}
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL/graphql',
  path: '/graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();

Returned Data Types

For the LoginBridge, there are several parameters that may be returned. They're described below:

Table: LoginBridge

ParameterTypeRequiredDefaultDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
additionalAttributesstring  Any additional attributes.
allowedUsers[User]yes A list of users allowed to access the bridge. See User.
anyUserAlreadyLoggedInViaLoginBridgebooleanyes True if any user in this organization has logged in to CrowdStream via LogScale. Requires manage organizations permissions.Whether to generate user names.
descriptionstringyes A description of the login bridge.
generateUserNamebooleanyes Whether to generate user names.
groupAttributestringyes Any group attributes.
groups[string]yes Any groups associated with the login bridge.
issuerstringyes The issuer of the login bridge.
loginUrlstringyes The URL for logging in.
namestringyes The name of the login bridge.
organizationIdAttributeNamestringyes The organization's unique identifier of the attribute name.
organizationNameAttributeNamestring  The organization's name of the attribute name.
publicSamlCertificatestringyes The publlic SAML certificate.
relayStateUUrlstringyes The relay state URL.
remoteIdstringyes The unique identifier of the remote connection.
samlEntityIdstringyes The unique identifier of the SAML entity.
showTermsAndConditionsbooleanyes Whether to show the terms and conditions.
termsDescriptionstringyes A description of the terms.
termsLinkstringyes A link to the terms and conditions.