1. Registry
  2. Packages
  3. Okta Provider
  4. API Docs
  5. getIdentitySourceSessions
Viewing docs for Okta v7.0.2
published on Tuesday, Oct 27, 2026 by Pulumi
okta logo
Viewing docs for Okta v7.0.2
published on Tuesday, Oct 27, 2026 by Pulumi

    Retrieves an identity source session by ID, or the most recently created session for the given identity source if no id is specified.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    // Look up the most recent session
    const latest = okta.getIdentitySourceSessions({
        identitySourceId: "<identity-source-id>",
    });
    // Look up a specific session by ID
    const byId = okta.getIdentitySourceSessions({
        identitySourceId: "<identity-source-id>",
        id: "<session-id>",
    });
    
    import pulumi
    import pulumi_okta as okta
    
    # Look up the most recent session
    latest = okta.get_identity_source_sessions(identity_source_id="<identity-source-id>")
    # Look up a specific session by ID
    by_id = okta.get_identity_source_sessions(identity_source_id="<identity-source-id>",
        id="<session-id>")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v7/go/okta"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Look up the most recent session
    		_, err := okta.GetIdentitySourceSessions(ctx, &okta.GetIdentitySourceSessionsArgs{
    			IdentitySourceId: "<identity-source-id>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Look up a specific session by ID
    		_, err = okta.GetIdentitySourceSessions(ctx, &okta.GetIdentitySourceSessionsArgs{
    			IdentitySourceId: "<identity-source-id>",
    			Id:               "<session-id>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        // Look up the most recent session
        var latest = Okta.GetIdentitySourceSessions.Invoke(new()
        {
            IdentitySourceId = "<identity-source-id>",
        });
    
        // Look up a specific session by ID
        var byId = Okta.GetIdentitySourceSessions.Invoke(new()
        {
            IdentitySourceId = "<identity-source-id>",
            Id = "<session-id>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.OktaFunctions;
    import com.pulumi.okta.inputs.GetIdentitySourceSessionsArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // Look up the most recent session
            final var latest = OktaFunctions.getIdentitySourceSessions(GetIdentitySourceSessionsArgs.builder()
                .identitySourceId("<identity-source-id>")
                .build());
    
            // Look up a specific session by ID
            final var byId = OktaFunctions.getIdentitySourceSessions(GetIdentitySourceSessionsArgs.builder()
                .identitySourceId("<identity-source-id>")
                .id("<session-id>")
                .build());
    
        }
    }
    
    variables:
      # Look up the most recent session
      latest:
        fn::invoke:
          function: okta:getIdentitySourceSessions
          arguments:
            identitySourceId: <identity-source-id>
      # Look up a specific session by ID
      byId:
        fn::invoke:
          function: okta:getIdentitySourceSessions
          arguments:
            identitySourceId: <identity-source-id>
            id: <session-id>
    
    terraform {
      required_providers {
        okta = {
          source = "pulumi/okta"
        }
      }
    }
    
    data "okta_identity_source_sessions" "latest" {
      identity_source_id = "<identity-source-id>"
    }
    data "okta_identity_source_sessions" "byId" {
      identity_source_id = "<identity-source-id>"
      id                 = "<session-id>"
    }
    
    # Look up the most recent session
    # Look up a specific session by ID
    

    Using getIdentitySourceSessions

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getIdentitySourceSessions(args: GetIdentitySourceSessionsArgs, opts?: InvokeOptions): Promise<GetIdentitySourceSessionsResult>
    function getIdentitySourceSessionsOutput(args: GetIdentitySourceSessionsOutputArgs, opts?: InvokeOutputOptions): Output<GetIdentitySourceSessionsResult>
    def get_identity_source_sessions(identity_source_id: Optional[str] = None,
                                     session_id: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetIdentitySourceSessionsResult
    def get_identity_source_sessions_output(identity_source_id: pulumi.Input[Optional[str]] = None,
                                     session_id: pulumi.Input[Optional[str]] = None,
                                     opts: Optional[InvokeOutputOptions] = None) -> Output[GetIdentitySourceSessionsResult]
    func GetIdentitySourceSessions(ctx *Context, args *GetIdentitySourceSessionsArgs, opts ...InvokeOption) (*GetIdentitySourceSessionsResult, error)
    func GetIdentitySourceSessionsOutput(ctx *Context, args *GetIdentitySourceSessionsOutputArgs, opts ...InvokeOption) GetIdentitySourceSessionsResultOutput

    > Note: This function is named GetIdentitySourceSessions in the Go SDK.

    public static class GetIdentitySourceSessions 
    {
        public static Task<GetIdentitySourceSessionsResult> InvokeAsync(GetIdentitySourceSessionsArgs args, InvokeOptions? opts = null)
        public static Output<GetIdentitySourceSessionsResult> Invoke(GetIdentitySourceSessionsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetIdentitySourceSessionsResult> Invoke(GetIdentitySourceSessionsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetIdentitySourceSessionsResult> getIdentitySourceSessions(GetIdentitySourceSessionsArgs args, InvokeOptions options)
    public static Output<GetIdentitySourceSessionsResult> getIdentitySourceSessions(GetIdentitySourceSessionsArgs args, InvokeOptions options)
    public static Output<GetIdentitySourceSessionsResult> getIdentitySourceSessions(GetIdentitySourceSessionsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: okta:index/getIdentitySourceSessions:getIdentitySourceSessions
      arguments:
        # arguments dictionary
    data "okta_get_identity_source_sessions" "name" {
        # arguments
    }

    The following arguments are supported:

    IdentitySourceId string
    ID of the identity source.
    SessionId string
    IdentitySourceId string
    ID of the identity source.
    SessionId string
    identity_source_id string
    ID of the identity source.
    session_id string
    identitySourceId String
    ID of the identity source.
    sessionId String
    identitySourceId string
    ID of the identity source.
    sessionId string
    identity_source_id str
    ID of the identity source.
    session_id str
    identitySourceId String
    ID of the identity source.
    sessionId String

    getIdentitySourceSessions Result

    The following output properties are available:

    Created string
    Timestamp when the session was created (RFC3339).
    Id string
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    IdentitySourceId string
    ID of the identity source.
    ImportType string
    The type of import. All imports are INCREMENTAL.
    LastUpdated string
    The timestamp when the identity source session was created (RFC3339).
    SessionId string
    Status string
    The current status of the identity source session.
    Created string
    Timestamp when the session was created (RFC3339).
    Id string
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    IdentitySourceId string
    ID of the identity source.
    ImportType string
    The type of import. All imports are INCREMENTAL.
    LastUpdated string
    The timestamp when the identity source session was created (RFC3339).
    SessionId string
    Status string
    The current status of the identity source session.
    created string
    Timestamp when the session was created (RFC3339).
    id string
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    identity_source_id string
    ID of the identity source.
    import_type string
    The type of import. All imports are INCREMENTAL.
    last_updated string
    The timestamp when the identity source session was created (RFC3339).
    session_id string
    status string
    The current status of the identity source session.
    created String
    Timestamp when the session was created (RFC3339).
    id String
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    identitySourceId String
    ID of the identity source.
    importType String
    The type of import. All imports are INCREMENTAL.
    lastUpdated String
    The timestamp when the identity source session was created (RFC3339).
    sessionId String
    status String
    The current status of the identity source session.
    created string
    Timestamp when the session was created (RFC3339).
    id string
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    identitySourceId string
    ID of the identity source.
    importType string
    The type of import. All imports are INCREMENTAL.
    lastUpdated string
    The timestamp when the identity source session was created (RFC3339).
    sessionId string
    status string
    The current status of the identity source session.
    created str
    Timestamp when the session was created (RFC3339).
    id str
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    identity_source_id str
    ID of the identity source.
    import_type str
    The type of import. All imports are INCREMENTAL.
    last_updated str
    The timestamp when the identity source session was created (RFC3339).
    session_id str
    status str
    The current status of the identity source session.
    created String
    Timestamp when the session was created (RFC3339).
    id String
    Unique identifier of the identity source session to look up. If omitted, the most recently created session is returned.
    identitySourceId String
    ID of the identity source.
    importType String
    The type of import. All imports are INCREMENTAL.
    lastUpdated String
    The timestamp when the identity source session was created (RFC3339).
    sessionId String
    status String
    The current status of the identity source session.

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Viewing docs for Okta v7.0.2
    published on Tuesday, Oct 27, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial