Question

Getting error 500 when creating SSO embed URL using the Golang SDK.

  • 26 July 2022
  • 0 replies
  • 21 views

Hello,

I am having trouble using the Go SDK when trying to create a SSO embedded URL. I have accomplished to successfuly create a valid SSO embed URL using a standard call call after reading the documentation.

When I am trying to use the SDK to create the embed URL, I am delivering the exact same parameters I am using when I am using the standard API call to the EmbedSSoParams struct and then uses the sdk.CreateSspEmbedUrl method, but I am getting an error 500 from the server: 

{
"error": {
"code": 500,
"messages": "response error. status=500 Internal Server Error. error=An unhandled lowlevel error occurred. The application logs may have details.\n"
}
}

As you can see, I can’t really understand from this message what is wrong with my code. Help would be appreciated, thanks!

Code with dummy values:
 

    // api settings initialized and verified.

sdk := v4.NewLookerSDK(rtl.NewAuthSession(apiSettings))

firstName := "jon"
lastName := "doe"
permissions := []string{"embed_browse_spaces", "access_data", "download_without_limit", "schedule_look_emails", "see_drill_overlay", "see_lookml_dashboards", "see_looks", "see_user_dashboards", "schedule_external_look_emails"}
groupIDs := ["1", "2", "3"]
externalGroupId := "externalGroupID"
forceLogoutLogin := false
sessionLength := int64((1 * time.Hour).Seconds())
timeZone := "UTC"
model := "someModel"
secretID := "secret from the SSO embed admin page"
embedSSOParams := v4.EmbedSsoParams{
TargetUrl: fmt.Sprintf("%s/%s/%s", apiSettings.BaseUrl, resource, resourceID),
SessionLength: &sessionLength,
ForceLogoutLogin: &forceLogoutLogin,
ExternalUserId: &usr.Email,
FirstName: &firstName,
LastName: &lastName,
UserTimezone: &timeZone,
Permissions: &permissions,
Models: &[]string{model},
GroupIds: &groupIDs,
ExternalGroupId: &externalGroupId,
UserAttributes: &map[string]any{},
SecretId: &secretID,
}
embedUrlResponse, err := sdk.CreateSsoEmbedUrl(embedSSOParams, &apiSettings)
if err != nil {
return "", err
}

return *embedUrlResponse.Url, nil

 


0 replies

Be the first to reply!

Reply