Hey guys :wave: I'm using Go SDK for Kratos and I ...
# talk-kratos
n
Hey guys 👋 I'm using Go SDK for Kratos and I stumbled into a bug. Some methods in IdentityAPI don't add
Authorization
header to the request. For example:
CreateRecoveryLinkForIdentityExecute
(api_identity.go#L594) Doesn't add auth header. While the
CreateIdentityExecute
(api_identity.go#L310) Does it:
Copy code
if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["oryAccessToken"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + " " + apiKey.Key
				} else {
					key = apiKey.Key
				}
				localVarHeaderParams["Authorization"] = key
			}
		}
	}
This leads to
401 Unauthorized
errors when I try to use this SDK. -- UPD I made a fork of the repo and added authorization option to OpenAPI specification. But when I try to re-generate code with openapi-generator there are a lot of changes. Can you please help me with openapi-generator for your SDK?
b
Hi! Thanks for the report and the PR! Unfortunately, our SDKs are generated from our source code which then get released into the client repositories. I’ve quickly created https://github.com/ory/kratos/pull/2937 to fix that. Thanks again for the report! 🙂
n
Got it, thank you!