Returns the decoded headers without verification of any kind. Args: token (str): A signed JWT to decode the headers from. Returns: dict: The dict representation of the token headers. Raises: JWTError: If there is an exception decoding the token.
(token)
| 185 | |
| 186 | |
| 187 | def get_unverified_header(token): |
| 188 | """Returns the decoded headers without verification of any kind. |
| 189 | |
| 190 | Args: |
| 191 | token (str): A signed JWT to decode the headers from. |
| 192 | |
| 193 | Returns: |
| 194 | dict: The dict representation of the token headers. |
| 195 | |
| 196 | Raises: |
| 197 | JWTError: If there is an exception decoding the token. |
| 198 | """ |
| 199 | try: |
| 200 | headers = jws.get_unverified_headers(token) |
| 201 | except Exception: |
| 202 | raise JWTError("Error decoding token headers.") |
| 203 | |
| 204 | return headers |
| 205 | |
| 206 | |
| 207 | def get_unverified_headers(token): |
no test coverage detected
searching dependent graphs…