Code Monkey home page Code Monkey logo

Comments (4)

ewanharris avatar ewanharris commented on August 24, 2024 2

Hey @alex-restless, we have a fix up for this at #174. I think we might (tentatively) cut a release next week as we'd like to also include some other changes alongside it

from go-auth0.

nickzelei avatar nickzelei commented on August 24, 2024

This issue still persists today, just got bit by it again as I was creating a new tenant and forgot that I originally hit this months ago.

The extra frustrating thing is that if you add a fake value here, and then remove it - the allowed_audiences appears to correctly come through as an empty list. I'm going to keep a fake-value listed in there for now as I know that works, and don't want it to magically rollback to being an empty string and start failing again.

An extra frustrating thing is in the Go SDK it doesn't tell you which field it is that is having troubles.
I had to bypass the SDK and make an HTTP request directly to the endpoint, but then try to marshal the same type. Then I was able to actually view the real issue.

Example:

	url := fmt.Sprintf("%s/api/v2/connections", c.domain)

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return nil, err
	}
	req.Header.Add("authorization", fmt.Sprintf("Bearer %s", accessToken))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		return nil, err
	}

	defer res.Body.Close()
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return nil, err
	}

	var connectionList []*management.Connection
	err = json.Unmarshal(body, &connectionList)
	if err != nil {
		panic(err)
	}
	return connectionList, nil

Prints the real error:

panic: json: cannot unmarshal string into Go struct field ConnectionOptionsGoogleOAuth2.allowed_audiences of type []string

Where as the SDK prints out a pretty cryptic:

failed to unmarshal response payload: json: cannot unmarshal string into Go struct field ConnectionList.connections of type []string

I'm guessing because it uses a wrapper ConnectionList type to get the pagination data.

from go-auth0.

alex-restless avatar alex-restless commented on August 24, 2024

This hit me again today, any chance of a bump? Appreciate there's a workaround so low priority.

The workaround for me was hinted in the linked issue - I went to the connection, edited the Allowed Mobile Client IDs with a value, then cleared it and hey-presto it works.

go-auth0/auth0#117 (comment)

from go-auth0.

mswezey23 avatar mswezey23 commented on August 24, 2024

Thank you for fixing this! Upgraded from 0.37.1 to 0.45. Worked like a charm! 🚀

from go-auth0.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.