scottdurow / dataverse-gen

Early-bound types generator for CDS/Dataverse
MIT License
20 stars 9 forks source link

Client ID and Secret auth #19

Open scottdurow opened 2 years ago

scottdurow commented 2 years ago

For non-interactive scenarios (or convenience) allow auth using a client id and secret - similar to the Power Platform CLI. This would by-pass the dataverse-auth profile, and use the secret as-is without any persisted token.

killerrin commented 1 year ago

Hey Scott, I was curious if you were ever able to get around to this? I wanted to try and play around with dataversify for our projects, except unfortunately our organization only enables us to authenticate through the Client Secret.

Thanks :)

scottdurow commented 1 year ago

Hi @killerrin - I got as far as implementing authorizeWithSecret (https://github.com/scottdurow/dataverse-ify/blob/a1ee701fecd113bb80b806bea9eb74f55936ab4e/src/webapi/node/NodeWebApi.ts#L17)

Now need to add parameters to dataverse-gen to allow authorizing using them.

scottdurow commented 1 year ago

This is now added to dataverse-gen@2.0.15

Usage: npx dataverse-get [command] [-u] [-t] [-a] [-cs]
  dataverse-gen : Generates from an existing .dataverse-gen.json file
  dataverse-gen init  : Adds .dataverse-gen.json config file to your project
  dataverse-gen eject : Adds the templates to your project to allow you to customize them!
  -u:  Optional: The url of the environment to connect to e.g. 'https://myorg.crm.dynamics.com'.
       If not provided, the environment is selected from the list created using dataverse-auth
  -t:  Optional: The Tenant Id if using an application user to connect.
  -a:  Optional: The Application Id if using an application user to connect.
  -s:  Optional: The Client Secret if using an application user to connect.