Hi! I just found out there is a chance app was malfunction. This happened when I try to using Sign In With Twitter but response for Access Token and Access Token Secret just returning “SANITIZED” as a value. No matter how much I try regenerating the keys, it always return SANITIZED.

Can you share the code? That’s 100% not a Twitter API error so I assume the app or code you’re using is returning that message.

func (c *Config) AccessToken(requestToken, requestSecret, verifier string) (accessToken, accessSecret string, err error) {
req, err := http.NewRequest(“POST”, c.Endpoint.AccessTokenURL, nil)
if err != nil {
return “”, “”, err
}
err = newAuther(c).setAccessTokenAuthHeader(req, requestToken, requestSecret, verifier)
if err != nil {
return “”, “”, err
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return “”, “”, err
}
// when err is nil, resp contains a non-nil resp.Body which must be closed
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
return “”, “”, fmt.Errorf(“oauth1: Server returned status %d”, resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return “”, “”, err
}
// ParseQuery to decode URL-encoded application/x-www-form-urlencoded body
values, err := url.ParseQuery(string(body))
if err != nil {
return “”, “”, err
}
accessToken = values.Get(oauthTokenParam)
accessSecret = values.Get(oauthTokenSecretParam)
if accessToken == “” || accessSecret == “” {
return “”, “”, errors.New(“oauth1: Response missing oauth_token or oauth_token_secret”)
}
return accessToken, accessSecret, nil
}

As code above, I’m pretty sure golang url package only extract value for given query and get method of url parse will return empty string if no query found

Hi @suvpen - we are looking into the “SANITIZED” credentials issue now. Thanks for the early report.

@suvpen have you tried to regenerate the credentials again? I’d suggest trying to regenerate them as a next step for debugging. If you see ‘Generate’ that could also work.

Let us know if this works for you.

Hi thank you for your response, the app is to auth others user. After I investigate, looks like if the user give access to the app successfully, revoke it via Apps and Session menu, and giving access again, the account got sanitized value when trying to get access token via sign in with twitter. The solution is to delete the app and create new one.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.