Db2

Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data


#Data
#Databases
#Operatingsystems
#Db2
#Databasesolutions
 View Only
  • 1.  VBA SSO login failed first try

    Posted 01/06/26 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 01/09/26 11:13 AM

    You can add a tiny delay and automatic retry. 



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



  • 3.  RE: VBA SSO login failed first try

    Posted 01/15/26 03:09 PM

    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
    ------------------------------