Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.


#Data
 View Only
  • 1.  VBA SSO login failed first try

    Posted Tue January 06, 2026 08:55 AM
    When we are using the following cod to sso lgoin in office 2016 64bit. It got login failed when first try. But it can login successfully once click the button again. Would you please advise?
     
    Private Sub CommandButtonLogonSSO_Click()
    On Error GoTo HANDLER:
    Dim oMessageSuppressor As CognosOfficeMessageSuppressor
            'Use the message suppressor to turn off all Cognos Office messages.
    Set oMessageSuppressor = New CognosOfficeMessageSuppressorApplication.Cursor = xlWaitDim server As String
    bSuccess = Reporting.LogonSSO(server, "SDataHierarchy", True, "negotiate")
    Application.Cursor = xlDefault
    If (bSuccess) Then
        MsgBox "Successfully connected to " + server, vbInformation
        Reporting.TaskPane.Show
        Reporting.TaskPane.Refresh
        Call Reporting.TaskPane.ChangeDataSource(server, "SDataHierarchy")
    Else
        Call MsgBox("Error connecting to " + server, vbExclamation)
    End If


    ------------------------------
    Dick Ma
    ------------------------------


  • 2.  RE: VBA SSO login failed first try

    Posted 28 days ago

    You can add a tiny delay and automatic retry. 



    ------------------------------
    Matheus Porsch
    Systems Administration - Kyndryl
    Brazil
    ------------------------------



  • 3.  RE: VBA SSO login failed first try

    Posted 22 days ago

    This usually happens because the Kerberos/SSO context isn't fully initialized on the first call. The first click triggers the Windows authentication handshake, and the second click succeeds once the ticket is available.

    Common fixes:

    • Ensure Office is started with the correct Windows credentials (no Run as different user).

    • Verify SPNs and Kerberos configuration on the Cognos server.

    • Add a short delay or retry logic after the first failed LogonSSO call.

    • Make sure IE/Edge settings (Intranet zone, Integrated Windows Auth) are correct, since Office uses them internally.

    This behavior is fairly common with SSO + Office integrations.



    ------------------------------
    Mark Johnson
    ------------------------------