We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
ipa --version returns: VERSION: 4.10.0, API_VERSION: 2.249
ipa --version
VERSION: 4.10.0, API_VERSION: 2.249
Using OtptokenAdd returns the following error:
OtptokenAdd
unexpected value for field Ipatokenotpkey: [map[__base64__:/FeLK5glrwwDEqpWGS1/R2pWRVmqk5pSp8M1jc0fJIw=]] ([]interface {})
The response is <nil>. However, the token is created in freeipa successfully, so I assume that this is problem with parsing of response.
<nil>
Could generating the library again help? And which version of freeipa is this library currently based on?
Thanks
The text was updated successfully, but these errors were encountered:
Hi @LukaszMoskala
Can you provide a minimal code sample to reproduce the error ?
Could generating the library again help ?
I don't think so. I think that this is due to a bad data type in the generated code.
And which version of freeipa is this library currently based on?
v4.6.8 was used to generate this library.
v4.6.8
Sorry, something went wrong.
This is exactly the code that I'm using (with password redacted)
package main import ( "crypto/rand" "crypto/tls" "encoding/base32" "encoding/base64" "encoding/hex" "log" "net/http" "github.com/ccin2p3/go-freeipa/freeipa" "github.com/google/uuid" ) func main() { tspt := &http.Transport{ TLSClientConfig: &tls.Config{ MinVersion: tls.VersionTLS12, }, } c, err := freeipa.Connect("HOST", tspt, "admin", "PASSWORD") if err != nil { log.Fatal(err) } tokenuuid := uuid.NewString() tokenbytes := make([]byte, 32) rand.Read(tokenbytes) log.Printf("Token UUID: %s", tokenuuid) log.Printf("Token base32: %s", base32.StdEncoding.EncodeToString(tokenbytes)) log.Printf("Token base64: %s", base64.StdEncoding.EncodeToString(tokenbytes)) log.Printf("Token hex: %s", hex.EncodeToString(tokenbytes)) addres, err := c.OtptokenAdd(tokenuuid, &freeipa.OtptokenAddArgs{}, &freeipa.OtptokenAddOptionalArgs{ Type: freeipa.String("totp"), Ipatokenowner: freeipa.String("test"), Ipatokenotpkey: freeipa.String(base32.StdEncoding.EncodeToString(tokenbytes)), Ipatokenotpalgorithm: freeipa.String("sha1"), Ipatokenotpdigits: freeipa.Int(6), All: freeipa.Bool(true), NoQrcode: freeipa.Bool(true), }) if err != nil { log.Fatal(err) } log.Printf("Response: %+v", addres) }
If I remove error checking at the end, the response is <nil>
Thank you for your time
No branches or pull requests
Hi,
ipa --version
returns:VERSION: 4.10.0, API_VERSION: 2.249
Using
OtptokenAdd
returns the following error:The response is
<nil>
. However, the token is created in freeipa successfully, so I assume that this is problem with parsing of response.Could generating the library again help? And which version of freeipa is this library currently based on?
Thanks
The text was updated successfully, but these errors were encountered: