Closed thdung002 closed 2 years ago
I tried with go get github.com/twilio/twilio-go then tried to use the generate accesstoken like the code below
package main import ( "os" "github.com/twilio/twilio-go/client/jwt" ) accountSid := os.Getenv("TWILIO_ACCOUNT_SID") applicationSid := os.Getenv("TWILIO_TWIML_APP_SID") apiKey := os.Getenv("TWILIO_API_KEY") apiSecret := os.Getenv("TWILIO_API_SECRET") identity := "fake123" params := jwt.AccessTokenParams{ AccountSid: accountSid, SigningKeySid: apiKey, Secret: apiSecret, Identity: identity, } jwtToken := jwt.CreateAccessToken(params) voiceGrant := &jwt.VoiceGrant{ Incoming: jwt.Incoming{Allow: true}, Outgoing: jwt.Outgoing{ ApplicationSid: applicationSid, ApplicationParams: "", }, } jwtToken.AddGrant(voiceGrant) token, err := jwtToken.ToJwt()
github.com/twilio/twilio-go/client/jwt: module github.com/twilio/twilio-go/client@latest found (v0.0.0-20210629184628-bf0945b77d96), but does not contain package github.com/twili o/twilio-go/client/jwt
Issue Summary
I tried with go get github.com/twilio/twilio-go then tried to use the generate accesstoken like the code below
Code Snippet
Exception/Log
Technical details: