initialize_cds_token: Set authentication token(s) used by other cdsR functions.

Description Usage Arguments Details Value

View source: R/token_management.R

Description

This is the first function you need to call in order to work with other functions in cdsR. Based on provided credentials it sets up a cds_token S3 generic object. It then lives in R session options (getOption("cdsR.tokens")).To get credentials you have to have a service account. Ask your adminds to provide you with all the secrets or get more details here.

Usage

1
2
3
4
5
6
7
8
initialize_cds_token(
  cds_instance_name,
  cds_instance_url,
  tenant_id,
  client_id,
  client_secret,
  web_api_version = "9.1"
)

Arguments

cds_instance_name

A character scalar with the name you want to use in order to identify a particular CDS instance. Typically something like "production", "test" or "dev". Used in other cdsR functions.

cds_instance_url

A character scalar with the url of your CDS/Dynamics instance. Should look like "https://yourinstancename.crm4.dynamics.com"

tenant_id

A character scalar with GUID of your tenant. Ask your Dynamics admins to provide this when in doubt.

client_id

A character scalar with GUID of service account you will use with this CDS instance. Ask your Dynamics admins to provide this when in doubt.

client_secret

A character scalar representing the service account's secret. Avoid keeping this in your code! Ask your dynamics admins to provide when in doubt and consult with your org's security expert how to store.

web_api_version

A character scalar describing which version of the CDS Web API you want to use when using this 'cds_token'. Default is "9.0".

Details

This is a very lighweight approach to authentication and is designed to minimise typing in interactive sessions, while still allowing for writing explicit, yet concise production-ready code. Notable features:

Note that you can call this function for a cds_instance_name in order to force refresh the token and/or change the url details.

Value

This function returns nothing and is used for side-effect of creating a cds_token object in R session's options to use by other cdsR functions.


jarekkupisz/cdsR documentation built on Dec. 20, 2021, 9:05 p.m.