Using Assertions as Authorization Grants to refresh token as described in `Section 4.1`_. .. _`Section 4.1`: https://tools.ietf.org/html/rfc7521#section-4.1
(self)
| 60 | self.token_auth.set_token(token) |
| 61 | |
| 62 | def refresh_token(self): |
| 63 | """Using Assertions as Authorization Grants to refresh token as |
| 64 | described in `Section 4.1`_. |
| 65 | |
| 66 | .. _`Section 4.1`: https://tools.ietf.org/html/rfc7521#section-4.1 |
| 67 | """ |
| 68 | generate_assertion = self.ASSERTION_METHODS[self.grant_type] |
| 69 | assertion = generate_assertion( |
| 70 | issuer=self.issuer, |
| 71 | subject=self.subject, |
| 72 | audience=self.audience, |
| 73 | claims=self.claims, |
| 74 | **self._kwargs, |
| 75 | ) |
| 76 | data = { |
| 77 | "assertion": to_native(assertion), |
| 78 | "grant_type": self.grant_type, |
| 79 | } |
| 80 | if self.scope: |
| 81 | data["scope"] = self.scope |
| 82 | |
| 83 | return self._refresh_token(data) |
| 84 | |
| 85 | def parse_response_token(self, resp): |
| 86 | if resp.status_code >= 500: |
no test coverage detected