arcrest.security package¶
Submodules¶
arcrest.security.security module¶
Handles all the security operations for the product logins.
-
class
arcrest.security.security.
AGOLTokenSecurityHandler
(username, password, org_url='https://www.arcgis.com', token_url=None, proxy_url=None, proxy_port=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
handles ArcGIS Online Token Base Security username - required - username to access AGOL services password - required - password for username above org_url - The url of that ArcGIS Organization. This url is
composed on the machine name and the instance name of the portal. For example: http://myportal.mycompany.com/portal for a Portal for ArcGIS Server instance.
- http://www.arcgis.com for ArcGIS Online
- http://myOnlineOrg.maps.arcgis.com for ArcGIS Online, but the unique url for your org
- token_url - optional - if URL is different than default AGOL token
- url, then enter it here for AGOL token service.
- proxy_url - optional - if proxy is required to access internet, the
- IP goes here.
- proxy_post - optional - if proxy is used and it’s not port 90 enter
- it here.
-
is_portal
¶
-
method
¶ returns the handler method
-
org_url
¶ gets/sets the organization URL
-
proxy_port
¶ gets the proxy port
-
proxy_url
¶ gets the proxy url
-
referer_url
¶ returns when the token was generated
-
token
¶ returns the token for the site
-
tokenExperationDate
¶ returns when the token is not valid
-
tokenObtainedDate
¶ returns when the token was generated
-
token_url
¶ returns the token url
-
username
¶ returns the username
-
class
arcrest.security.security.
AGSTokenSecurityHandler
(username, password, org_url=None, token_url=None, proxy_url=None, proxy_port=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
handles ArcGIS Server Security username - required - person accessing server password - required - login credential token_url - required - URL to generate a token on server proxy_url - optional - IP of proxy proxy_port - optional - port of the proxy server
-
method
¶ returns the handler method
-
proxy_port
¶ gets the proxy port
-
proxy_url
¶ gets the proxy url
-
referer_url
¶ returns when the token was generated
-
token
¶ returns the token for the site
-
tokenExperationDate
¶ returns when the token is not valid
-
tokenObtainedDate
¶ returns when the token was generated
-
token_url
¶ returns the token url
-
username
¶ returns the username
-
-
class
arcrest.security.security.
ArcGISTokenSecurityHandler
(proxy_url=None, proxy_port=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
handles ArcGIS Maps Token Base Security
-
is_portal
¶
-
method
¶ returns the handler method
-
org_url
¶ gets/sets the organization URL
-
proxy_port
¶ gets the proxy port
-
proxy_url
¶ gets the proxy url
-
referer_url
¶ returns when the token was generated
-
token
¶ returns the token for the site
-
tokenExperationDate
¶ returns when the token is not valid
-
username
¶ returns the username
-
-
class
arcrest.security.security.
CommunityMapsSecurityHandler
(url, username, password, proxy_url=None, proxy_port=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
Handler that allows access to the community maps program
-
securityhandler
¶ ges/set the AGOLTokenSecurityHandler
-
token
¶ generates a token
-
-
class
arcrest.security.security.
LDAPSecurityHandler
(org_url, username, password, proxy_url=None, proxy_port=None, referer_url=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
This Security Handler handles LDAP based security.
gets the cookiejar
-
handler
¶ returns the handler
-
is_portal
¶
-
method
¶ get the security handler type
-
org_url
¶ gets the org_url
-
password
¶ gets/sets the current password
-
portalServerHandler
(serverUrl, username=None)[source]¶ returns a handler to access a federated server
- serverUrl - url to the server. Example:
- https://server.site.com/arcgis
- username - the portal site username. if None is passed, it obtains
- it from the portal properties
- Outout:
- returns a PortalServerSecurityHandler object
Usage: >>> # access the administration site >>> serverUrl=”https://mysite.site.com/arcgis” >>> newSH = sh.portalServerHandler(serverUrl=serverUrl,
username=None)>>> agsAdmin = AGSAdministration(url=serverUrl, securityHandler=newSH) >>> print agsAdmin.info >>> # access a secure service from portal handler >>> msUrl = "https://mysite.site.com:6443/arcgis/rest/services/SampleWorldCities/MapServer" >>> ms = arcrest.ags.MapService(url=msUrl, securityHandler=newSH) >>> print ms.mapName
-
proxy_port
¶ gets the proxy port
-
proxy_url
¶ gets the proxy url
-
referer_url
¶ gets the referer url
-
token
¶ gets the token
-
username
¶ gets/sets the username
-
class
arcrest.security.security.
NTLMSecurityHandler
(org_url, username, password, proxy_url=None, proxy_port=None, referer_url=None)[source]¶ Bases:
arcrest.security.security.LDAPSecurityHandler
performs NTLM/Kerberos security handling
gets the cookiejar
-
handler
¶ gets the security handler for the class
-
class
arcrest.security.security.
OAuthSecurityHandler
(client_id, secret_id, org_url, token_url=None, proxy_url=None, proxy_port=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
Handles AGOL OAuth Security Inputs:
client_id - OAuth client key secret_id - OAuth secret key org_url - The url of that ArcGIS Organization. This url is
composed on the machine name and the instance name of the portal. For example: http://myportal.mycompany.com/portal for a Portal
- for ArcGIS Server instance.
- http://www.arcgis.com for ArcGIS Online
- http://myOnlineOrg.maps.arcgis.com for ArcGIS Online, but the unique url for your org
token_url - optional - url to where the token is obtained proxy_url - optional - proxy url as a string proxy_port - optional - proxy port as integer
- Output:
- OAuthSecurityHandler Class Object
-
client_id
¶ returns the client id
-
is_portal
¶
-
method
¶ returns the handler method
-
org_url
¶ gets/sets the organization URL
-
proxy_port
¶ gets the proxy port
-
proxy_url
¶ gets the proxy url
-
referer_url
¶ returns when the token was generated
-
secret_id
¶ returns * for secret id
-
token
¶ obtains a token from the site
-
tokenExperationDate
¶ returns when the token is not valid
-
tokenObtainedDate
¶ returns when the token was generated
-
token_url
¶ returns the token url
-
class
arcrest.security.security.
PKISecurityHandler
(org_url, keyfile, certificatefile, proxy_url=None, proxy_port=None, referer_url=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
This Security Handler handles PKI based security
-
class
HTTPSClientAuthHandler
(key, cert)[source]¶ Bases:
urllib2.HTTPSHandler
-
httplib
= <module 'httplib' from 'C:\Python27\ArcGIS10.2\lib\httplib.pyc'>¶
-
-
PKISecurityHandler.
certificate
¶ gets/sets the certificate file
gets the cookiejar
-
PKISecurityHandler.
handler
¶ returns the handler
-
PKISecurityHandler.
is_portal
¶
-
PKISecurityHandler.
key_file
¶ returns the key file
-
PKISecurityHandler.
method
¶ get the security handler type
-
PKISecurityHandler.
org_url
¶ gets the org_url
-
PKISecurityHandler.
proxy_port
¶ gets the proxy port
-
PKISecurityHandler.
proxy_url
¶ gets the proxy url
-
PKISecurityHandler.
referer_url
¶ gets the referer url
-
PKISecurityHandler.
token
¶ gets the token
-
PKISecurityHandler.
username
¶ returns the username
-
class
-
class
arcrest.security.security.
PortalServerSecurityHandler
(tokenHandler, serverUrl, referer, handler=None, jar=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
This service is designed to allow users manage a server from a Portal site credentials. This means a user can get an ArcGIS Server Token from a Portal login to manage and use secure services. It is not designed for users to create this object through code, but rather it is generated by the system.
gets the cookiejar
-
handler
¶ gets/sets a handler
-
is_portal
¶
-
method
¶ returns the handler method
-
referer
¶ gets/sets the referer object
-
serverUrl
¶ gets/sets the server url
-
token
¶ gets the AGS server token
-
class
arcrest.security.security.
PortalTokenSecurityHandler
(username, password, org_url, token_url=None, proxy_url=None, proxy_port=None, handler=None, jar=None)[source]¶ Bases:
arcrest._abstract.abstract.BaseSecurityHandler
Handles connection to a Portal Site
- Inputs:
username - name of the user password - password for user org_url - The url of that ArcGIS Organization. This url is
composed on the machine name and the instance name of the portal. For example: http://myportal.mycompany.com/portal for a Portal for ArcGIS Server instance.
- http://www.arcgis.com for ArcGIS Online
- http://myOnlineOrg.maps.arcgis.com for ArcGIS Online, but the unique url for your org
proxy_url - URL of the proxy proxy_port - proxy port
gets the cookiejar
-
handler
¶ gets/sets a handler
-
is_portal
¶
-
method
¶ returns the handler method
-
org_url
¶ gets/sets the organization URL
-
portalServerHandler
(serverUrl, username=None)[source]¶ returns a handler to access a federated server
- serverUrl - url to the server. Example:
- https://server.site.com/arcgis
- username - the portal site username. if None is passed, it obtains
- it from the portal properties
- Outout:
- returns a PortalServerSecurityHandler object
Usage: >>> # access the administration site >>> serverUrl=”https://mysite.site.com/arcgis” >>> newSH = sh.portalServerHandler(serverUrl=serverUrl,
username=None)>>> agsAdmin = AGSAdministration(url=serverUrl, securityHandler=newSH) >>> print agsAdmin.info >>> # access a secure service from portal handler >>> msUrl = "https://mysite.site.com:6443/arcgis/rest/services/SampleWorldCities/MapServer" >>> ms = arcrest.ags.MapService(url=msUrl, securityHandler=newSH) >>> print ms.mapName
-
proxy_port
¶ gets the proxy port
-
proxy_url
¶ gets the proxy url
-
referer_url
¶ returns when the token was generated
-
token
¶ returns the token for the site
-
tokenExperationDate
¶ returns when the token is not valid
-
tokenObtainedDate
¶ returns when the token was generated
-
token_url
¶ returns the token url
-
username
¶ returns the username