{"id":21454,"library":"igwn-auth-utils","title":"IGWN Auth Utils","description":"Authorisation utilities for the IGWN (International Gravitational-Wave Observatory Network). Provides token management, scitoken creation/validation, and authentication helpers. Current version 1.4.0, released May 2025. Active development, monthly releases.","status":"active","version":"1.4.0","language":"python","source_language":"en","source_url":"https://github.com/gwpy/igwn-auth-utils","tags":["authentication","authorization","igwn","scitokens","jwt"],"install":[{"cmd":"pip install igwn-auth-utils","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Token signing and verification","package":"cryptography","optional":false},{"reason":"HTTP requests to auth endpoints","package":"requests","optional":false},{"reason":"JWT encoding/decoding","package":"pyjwt","optional":false}],"imports":[{"note":"Package uses underscores in module path.","wrong":"from igwn.auth_utils import get_access_token","symbol":"get_access_token","correct":"from igwn_auth_utils import get_access_token"},{"note":null,"wrong":null,"symbol":"create_scitoken","correct":"from igwn_auth_utils.scitokens import create_scitoken"}],"quickstart":{"code":"import os\nfrom igwn_auth_utils import get_access_token\n\ntoken = get_access_token(\n    token_url=os.environ.get('IGWN_TOKEN_URL', 'https://example.com/token'),\n    client_id=os.environ.get('IGWN_CLIENT_ID', ''),\n    client_secret=os.environ.get('IGWN_CLIENT_SECRET', '')\n)\nprint(f'Token: {token[:20]}...')","lang":"python","description":"Fetch an access token using client credentials."},"warnings":[{"fix":"Update imports to use underscores.","message":"Version 1.0.0 changed import paths from `igwn.auth_utils` to `igwn_auth_utils`.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Use `get_access_token` which returns a token object with a `header` property.","message":"`create_authorization_header` is deprecated in 1.2.0+ in favor of `get_access_token`.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Verify the audience claim in the token matches the expected value.","message":"Scitoken validation requires the `audience` parameter to match exactly; mismatches cause silent failures.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Upgrade to latest version: pip install --upgrade igwn-auth-utils","cause":"Installed old version (<1.0.0) with different package name.","error":"ModuleNotFoundError: No module named 'igwn_auth_utils'"},{"fix":"Ensure token is a valid JWT and check that you're using the correct public key.","cause":"Token string is malformed or uses wrong algorithm.","error":"ValueError: Invalid token: not a valid JWT"},{"fix":"Double-check client_id, client_secret, and token_url environment variables.","cause":"Client credentials or token URL are incorrect.","error":"requests.exceptions.HTTPError: 401 Client Error: Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}