FusionAuth / fusionauth-site

Website and documentation for FusionAuth
https://fusionauth.io
Other
49 stars 47 forks source link

Audit IdP providers, lambdas. #832

Open jobannon opened 3 years ago

jobannon commented 3 years ago

Summary

The initial release is complete. Audit documentation to inaccuracies or other improvements.

Tasks

Related

matthewhartstonge commented 2 years ago

Would be good to have the schema of the various params into the reconcile function so we don't have to inject console.debug statements to find out what the inputs are..

Logging the objects out is mentioned at https://fusionauth.io/docs/v1/tech/lambdas/, but again, it would be nice to know straight up what the expected data structure is. 👍

When logging objects, you’ll need to stringify them to see their data.

function populate(jwt, user, registration) {
  //...
  console.log(user); // doesn't log any data other than the fact a user is an object. Probably not what you want.
  console.log(JSON.stringify(user)); // outputs all the properties of the user object.
  console.log(JSON.stringify(user, null, ' ')); // pretty prints the user object.
  //...
}
matthewhartstonge commented 2 years ago

Have also just noticed that the documentation for lambda types is not up to date.

As returned from the FusionAuth API when trying to upload a client credentials Lambda:

Values accepted for Enum class: [
- ClientCredentialsJWTPopulate
- SAMLv2Reconcile
- FacebookReconcile
- OpenIDReconcile
- SonyPSNReconcile
- LinkedInReconcile
- JWTPopulate
- EpicGamesReconcile
- SAMLv2Populate, 
- AppleReconcile
- GoogleReconcile
- NintendoReconcile
- XboxReconcile
- SteamReconcile
- LDAPConnectorReconcile
- ExternalJWTReconcile
- TwitterReconcile
- TwitchReconcile
- HYPRReconcile
]

Compared to the current documented list of types:

The lambda type. The possible values are:
- JWTPopulate
- OpenIDReconcile
- SAMLv2Reconcile
- SAMLv2Populate
- AppleReconcile   AVAILABLE SINCE 1.17.0
- ExternalJWTReconcile   AVAILABLE SINCE 1.17.0
- FacebookReconcile   AVAILABLE SINCE 1.17.0
- GoogleReconcile   AVAILABLE SINCE 1.17.0
- HYPRReconcile   AVAILABLE SINCE 1.17.0
- TwitterReconcile   AVAILABLE SINCE 1.17.0
- LDAPConnectorReconcile   AVAILABLE SINCE 1.18.0
mooreds commented 2 years ago

Thanks @matthewhartstonge I filed an issue to update the docs w/r/t lambda types.

The schema of the objects passed to the lambda are defined elsewhere (user, registration) or are specific to the idp (jwt). Are docs for the latter what you are looking for?

matthewhartstonge commented 2 years ago

Hey @mooreds whoops, missed this.

Yeah, a link to the schema or having the schema in the same place for ease of use/knowing that a lambda 'user' is the same as the user model would be grand 😄

Maybe I'm a little too worn from one too many APIs where an object/parameter is labelled the same but contains a different schema.. haha 👴💻