Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
ciecplib 0.9.0
ciecplib 0.9.0
  • Installation

Modules

  • ciecplib
    • get
    • get_cert
    • get_cookie
    • head
    • post
    • Session
  • ciecplib.cookies
    • extract_session_cookie
    • has_session_cookies
    • load_cookiejar
    • ECPCookieJar
  • ciecplib.kerberos
    • find_principal
    • has_credential
    • realm
  • ciecplib.utils
    • get_ecpcookie_path
    • get_idp_url
    • get_idps
    • get_x509_proxy_path
    • random_string
    • EcpIdentityProvider
  • ciecplib.x509
    • check_cert
    • generate_proxy
    • load_cert
    • load_pkcs12
    • print_cert_info
    • time_left
    • write_cert

Command-line scripts

  • ecp-cert-info
  • ecp-curl
  • ecp-get-cert
  • ecp-get-cookie
Back to top
View this page

ecp-get-cookie¶

Authenticate and store session cookies.

ecp-get-cookie queries a SAML/ECP-enabled service, automatically performing authentication where required, and saves cookies to use in future requests to the same service.

There are two usages:

$ ecp-get-cookie -i ‘My Institution’ -u jsmith https://campus01.edu/my/secret/page

to authenticate with a password prompt, or

$ ecp-get-cookie -i ‘My Institution’ -k https://campus01.edu/my/secret/page

to reuse an existing kerberos (kinit) credential.

By default the cookie file is created and stored in a location defined by either

  • /tmp/ecpcookie.u{uid} (Unix), or

  • C:\Windows\Temp\ecpcookie.{username} (Windows)

Usage: ecp-get-cookie [-i IDENTITY_PROVIDER] [-k] [-u USERNAME] [-h] [-l] [-V]
                      [-c cookiefile] [-d] [-r] [-v] [-X]
                      URL

Required arguments¶

URL

service URL for which to generate cookies

Authentication options¶

-i, --identity-provider

name of institution providing the identity (e.g. ‘Cardiff University’), or domain name of IdP host (e.g. idp.cf.ac.uk), see –list-idps for a list of Identity Provider (IdPs) and their IdP URL. Shortened institution names (e.g. ‘Cardiff’) can be given as long as they uniquely match a full institution name known by CILogon

-k, --kerberos

enable kerberos negotiation

Default: False

-u, --username

authentication username, will be prompted for if not given and not using –kerberos

Other options¶

-c, --cookiefile

cookie file to create/reuse/destroy

Default: '/tmp/ecpcookie.u1005'

-d, --debug

write debug output to stdout (implies –verbose)

Default: False

-r, --reuse

reuse existing cookies if possible

Default: False

-v, --verbose

write verbose output to stdout

Default: False

-X, --destroy

destroy existing cookie file

Default: False

Helper arguments¶

-l, --list-idps

show IdP names and URLs and exit

-V, --version

show program’s version number and exit

Previous
ecp-get-cert
Copyright © 2025, Cardiff University
Made with Sphinx and @pradyunsg's Furo
On this page
  • ecp-get-cookie
    • Required arguments
    • Authentication options
    • Other options
    • Helper arguments