<ph type="x-smartling-placeholder"></ph>
현재 Apigee Edge 문서를 보고 있습니다.
Apigee X 문서. 정보
대상
지정된 OAuth V2 승인 코드 또는 액세스 토큰을 삭제합니다.
샘플
액세스 토큰 삭제
다음은 OAuth 2.0 액세스 토큰을 삭제하는 데 사용되는 정책 예시입니다. 아래 예시에서는 access_token이라는 헤더를 찾아 요청 메시지에서 삭제할 액세스 토큰을 찾습니다.
<DeleteOAuthV2Info name="DeleteAccessToken">
<AccessToken ref="request.header.access_token"></AccessToken>
</DeleteOAuthV2Info>승인 코드 삭제
다음은 OAuth 2.0 승인 코드를 삭제하는 데 사용되는 정책 예시입니다. 아래 예시에서는 code이라는 쿼리 매개변수를 찾아 요청 메시지에서 삭제할 인증 코드를 찾습니다.
<DeleteOAuthV2Info name="DeleteAuthCode">
<AuthorizationCode ref="request.queryparam.code"></AuthorizationCode>
</DeleteOAuthV2Info>요소 참조
요소 참조는 DeleteOAuthV2Info 정책의 요소 및 속성을 설명합니다.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DeleteOAuthV2Info async="false" continueOnError="false" enabled="true" name="DeleteOAuthV2Info-1"> <DisplayName>Delete OAuth v2.0 Info 1</DisplayName> <AccessToken ref={some-variable}></AccessToken> <!--<AuthorizationCode ref={some-variable}></AuthorizationCode>--> <Attributes/> </DeleteOAuthV2Info
<DeleteOAuthV2Info> 속성
<DeleteOAuthV2Info async="false" continueOnError="false" enabled="true" name="Delete-OAuth-v20-Info-1">
| 속성 | 설명 | 기본값 | 접속 상태 |
|---|---|---|---|
| 비동기 |
요청/응답 흐름을 제공하는 풀과 상이한 스레드 풀에서 정책을 실행해야 하는 것으로 지정하려면 이 설정은 내부 최적화에만 사용됩니다. |
거짓 | 선택사항 |
| continueOnError |
대부분의 정책은 장애가 발생할 때 오류를 반환해야 합니다. 이 속성을 |
거짓 | 선택사항 |
| 사용 설정됨 | 정책의 시행 여부를 결정합니다. false로 설정되면 정책이 '사용 중지'되어 시행되지 않습니다(정책이 흐름에 연결된 상태로 유지되더라도 마찬가지). |
true | 선택사항 |
| 이름 |
정책의 내부 이름입니다. 이 이름은 정책을 흐름에 연결하기 위해 단계 요소에서 참조됩니다. 참고: 이름에 사용할 수 있는 문자는 |
해당 사항 없음 | 필수 |
<AccessToken> 요소
삭제할 액세스 토큰이 위치한 변수를 식별합니다. 예를 들어 액세스 토큰이 'access_token'이라는 쿼리 매개변수로 요청 메시지에 연결된 경우 request.queryparam.access_token을 지정합니다. 토큰을 참조하는 모든 유효한 변수를 사용할 수 있습니다. 또는 리터럴 토큰 문자열(드문 사례)을 전달할 수도 있습니다.
<AccessToken ref="request.queryparam.access_token"></AccessToken>
| 기본값: | 해당 사항 없음 |
| Presence: | <AccessToken> 또는 <AuthorizationCode>가 필요합니다. |
| 유형: | 문자열 |
속성
| 속성 | 설명 | 기본값 | 접속 상태 |
|---|---|---|---|
| ref |
액세스 토큰 변수입니다. 일반적으로 흐름 변수에서 가져옵니다. 예를 들면 |
해당 사항 없음 | 선택사항 |
<AuthorizationCode> 요소
삭제할 승인 코드가 위치한 변수를 식별합니다. 예를 들어 인증 코드가 'code'라는 쿼리 매개변수로 요청 메시지에 연결된 경우 request.queryparam.code를 지정합니다. 토큰을 참조하는 모든 유효한 변수를 사용할 수 있습니다.
또는 리터럴 토큰 문자열(드문 사례)을 전달할 수도 있습니다.
<AuthorizationCode ref="request.queryparam.code"></AuthorizationCode>
| 기본값: | 해당 사항 없음 |
| Presence: | <AccessToken> 또는 <AuthorizationCode>가 필요합니다. |
| 유형: | 문자열 |
속성
| 속성 | 설명 | 기본값 | 접속 상태 |
|---|---|---|---|
| ref |
액세스 토큰 변수입니다. 일반적으로 흐름 변수에서 가져옵니다. 예를 들면 |
해당 사항 없음 | 선택사항 |
<DisplayName> 요소
관리 UI 프록시 편집기에서 정책에 라벨을 지정하는 자연어 이름입니다. 생략하면 정책 이름 속성이 사용됩니다.
<DisplayName>DeleteOAuthV2Info 1</DisplayName>
| 기본값: | 정책의 name 속성 값입니다. |
| Presence: | 선택사항 |
| 유형: | 문자열 |
오류 참조
This section describes the fault codes and error messages that are returned and fault variables that are set by Edge when this policy triggers an error. This information is important to know if you are developing fault rules to handle faults. To learn more, see What you need to know about policy errors and Handling faults.
Runtime errors
These errors can occur when the policy executes.
| Fault code | HTTP status | Cause |
|---|---|---|
steps.oauth.v2.invalid_access_token |
401 | The access token sent to the policy is invalid. |
steps.oauth.v2.invalid_request-authorization_code_invalid |
401 | The authorization code sent to the policy is invalid. |
steps.oauth.v2.InvalidAPICallAsNoApiProductMatchFound |
401 | Please see this Apigee Community post for information about troubleshooting this error. |
Deployment errors
Refer to the message reported in the UI for information about deployment errors.
Fault variables
These variables are set when this policy triggers an error at runtime.
| Variables | Where | Example |
|---|---|---|
fault.name="fault_name" |
fault_name is the name of the fault, as listed in the Runtime errors table above. The fault name is the last part of the fault code. | fault.name = "invalid_access_token" |
oauthV2.policy_name.failed |
policy_name is the user-specified name of the policy that threw the fault. | oauthV2.DeleteTokenInfo.failed = true |
oauthV2.policy_name.fault.name |
policy_name is the user-specified name of the policy that threw the fault. | oauthV2.DeleteTokenInfo.fault.name = invalid_access_token |
oauthv2.policy_name.fault.cause |
policy_name is the user-specified name of the policy that threw the fault. | oauthV2.DeleteTokenInfo.cause = Invalid Access Token |
Example error response
{
"fault": {
"faultstring": "Invalid Access Token",
"detail": {
"errorcode": "keymanagement.service.invalid_access_token"
}
}
}Example fault rule
<faultrule name="VariableOfNonMsgType"></faultrule><FaultRule name="DeleteOAuthV2Info_Faults">
<Step>
<Name>AM-InvalidTokenResponse</Name>
</Step>
<Condition>(fault.name = "invalid_access_token")</Condition>
</FaultRule>스키마
각 정책 유형은 XML 스키마(.xsd)로 정의됩니다. 참고로 GitHub에서 정책 스키마를 사용할 수 있습니다.