Get Authorized Connected Apps for a Member - Stytch Docs

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

C#

// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps
const stytch = require('stytch');

const client = new stytch.B2BClient({
  project_id: '${projectId}',
  secret: '${secret}',
});

const params = {
  organization_id: "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
  member_id: "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
};

const options = {
  authorization: {
    session_token: '${sessionToken}',
  },
};

client.Organizations.Members.GetConnectedApps(params, options)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });

Go

// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps
package main

import (
    "context"
    "log"

"github.com/stytchauth/stytch-go/v18/stytch/b2b/b2bstytchapi"
    "github.com/stytchauth/stytch-go/v18/stytch/b2b/organizations/members"
    "github.com/stytchauth/stytch-go/v18/stytch/methodoptions"
)

func main() {
    client, err := b2bstytchapi.NewClient(
        "${projectId}",
        "${secret}",
    )
    if err != nil {
        log.Fatalf("error instantiating client: %v", err)
    }

params := &members.GetConnectedAppsParams{
        OrganizationID: "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
        MemberID:       "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
    }

options := &members.GetConnectedAppsParamsOptions{
        Authorization: methodoptions.Authorization{
            SessionToken: "${sessionToken}",
        },
    }

resp, err := client.Organizations.Members.GetConnectedApps(context.Background(), params, options)
    if err != nil {
        log.Fatalf("error in method call: %v", err)
    }

log.Println(resp)
}

Java

// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps
package com.example;

import com.stytch.java.b2b.models.organizationsmembers.GetConnectedAppsRequest;
import com.stytch.java.b2b.models.organizationsmembers.GetConnectedAppsRequestOptions;
import com.stytch.java.b2b.StytchB2BClient;
import com.stytch.java.common.methodoptions.Authorization;
import com.stytch.java.common.StytchResult;

public class Main {
    public static void main(String[] args) {
        StytchB2BClient.configure("${projectId}", "${secret}");

GetConnectedAppsRequest params = new GetConnectedAppsRequest();
        params.setOrganizationId("organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931");
        params.setMemberId("member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f");

GetConnectedAppsRequestOptions options = new GetConnectedAppsRequestOptions();
        Authorization authorization = new Authorization();
        authorization.setSessionToken("${sessionToken}");
        options.setAuthorization(authorization);

Object result = StytchB2BClient.getOrganizations().getMembers().getConnectedApps(params, options);
        if (result instanceof StytchResult.Success) {
          System.out.println(((StytchResult.Success) result).getValue());
        } else {
          System.out.println(((StytchResult.Error) result).getException());
        }
    }
}

Python

# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps
from stytch import B2BClient
from stytch.b2b.models.organizations_members import GetConnectedAppsRequestOptions
from stytch.shared.method_options import Authorization

client = B2BClient(
    project_id="${projectId}",
    secret="${secret}",
)

resp = client.organizations.members.get_connected_apps(
    organization_id="organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
    member_id="member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
    method_options=GetConnectedAppsRequestOptions(
        authorization=Authorization(
            session_token="${sessionToken}",
        ),
    ),
)

print(resp)

cURL

# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps
curl --request GET \
  --url https://test.stytch.com/v1/b2b/organizations/organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931/members/member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f/connected_apps \
  -u '${projectId}:${secret}' \
  -H 'Content-Type: application/json' \
  -H "X-Stytch-Member-Session: ${sessionToken}"

Response

Retrieves a list of Connected Apps with which the Member has successfully completed an authorization flow. If the Member revokes a Connected App’s access (e.g. via the Revoke Connected App endpoint) then the Connected App will no longer be returned in the response. A Connected App’s access may also be revoked if the Organization’s allowed Connected App policy changes.