Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer
  • arcgisutils

Authorization

Source:R/arc-auth.R
auth.Rd

Authorize your R session to connect to an ArcGIS Portal. See details.

Usage

auth_code(client=Sys.getenv("ARCGIS_CLIENT"), host=arc_host())auth_client(  client=Sys.getenv("ARCGIS_CLIENT"),  secret=Sys.getenv("ARCGIS_SECRET"),  host=arc_host(),  expiration=120)auth_binding()auth_user(  username=Sys.getenv("ARCGIS_USER"),  password=Sys.getenv("ARCGIS_PASSWORD"),  host=arc_host(),  expiration=60)auth_key(api_key=Sys.getenv("ARCGIS_API_KEY"), host=arc_host())refresh_token(token, client=Sys.getenv("ARCGIS_CLIENT"), host=arc_host())validate_or_refresh_token(token,  client=Sys.getenv("ARCGIS_CLIENT"),  host=arc_host(),  refresh_threshold=10,  call=rlang::caller_env())

Arguments

client

an OAuth 2.0 developer application client ID. By default uses theenvironment variableARCGIS_CLIENT.

host

default"https://www.arcgis.com". The host of your ArcGIS Portal.

secret

an OAuth 2.0 developer application secret. By default uses the environmentvariableARCGIS_SECRET.

expiration

the duration of the token in minutes.

username

defaultSys.getenv("ARCGIS_USER").Your username to login.Do not hard code this value.

password

defaultSys.getenv("ARCGIS_PASSWORD").Your password to login.Do not hard code this value.

api_key

defaultSys.getenv("ARCGIS_API_KEY"). A character scalar of an ArcGIS Developer API key.

token

anhttr2_token as created byauth_code() or similar

refresh_threshold

default10. If token expiry is within thisthreshold (in seconds) the token will be refreshed only if arefresh_token is available. Token refreshing is only possible withauth_code() flow.

call

The execution environment of a currently runningfunction, e.g.call = caller_env(). The corresponding functioncall is retrieved and mentioned in error messages as the sourceof the error.

You only need to supplycall when throwing a condition from ahelper function which wouldn't be relevant to mention in themessage.

Can also beNULL or adefused function call torespectively not display any call or hard-code a code to display.

For more information about error calls, seeIncluding function calls in error messages.

Value

anhttr2_token

Details

ArcGIS Online and Enterprise Portals utilize OAuth2 authorization via their REST APIs.

  • auth_code() is the recommend OAuth2 workflow for interactive sessions

  • auth_client() is the recommended OAuth2 workflow for non-interactive sessions

  • auth_user() uses legacy username and password authorization using thegenerateToken endpoint. It is only recommended for legacy systems that do not implement OAuth2.

  • auth_binding() fetches a token from the active portal set byarcgisbinding. Usesarcgisbinding::arc.check_portal() to extract the authorization token. Recommended if using arcgisbinding.

Examples

if(FALSE){# \dontrun{auth_code()auth_client()auth_user()auth_key()auth_binding()}# }

Was this page helpful?

Your browser is no longer supported. Please upgrade your browser for the best experience. See ourbrowser deprecation post for more details.


[8]ページ先頭

©2009-2025 Movatter.jp