Add CLIENT_SECRET_EXPIRED sdk status code Return CLIENT_SECRET_EXPIRED sdk status code in response to HTTP_CONFLICT(409) response from RPA server when authenticating.
Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-core/commit/fbb695cd Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-core/tree/fbb695cd Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-core/diff/fbb695cd Branch: refs/heads/master Commit: fbb695cd07ec50566c685bc61b260a107cc9f5c1 Parents: d388206 Author: Slav Klenov <[email protected]> Authored: Fri Sep 2 14:57:29 2016 +0300 Committer: Slav Klenov <[email protected]> Committed: Fri Sep 2 14:57:29 2016 +0300 ---------------------------------------------------------------------- src/mpin_sdk.cpp | 5 +++++ src/mpin_sdk.h | 2 ++ 2 files changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-core/blob/fbb695cd/src/mpin_sdk.cpp ---------------------------------------------------------------------- diff --git a/src/mpin_sdk.cpp b/src/mpin_sdk.cpp index d438156..9077fac 100644 --- a/src/mpin_sdk.cpp +++ b/src/mpin_sdk.cpp @@ -485,6 +485,11 @@ Status MPinSDK::HttpResponse::TranslateToMPinStatus(Context context) m_mpinStatus.SetStatusCode(Status::IDENTITY_NOT_AUTHORIZED); m_mpinStatus.SetErrorMessage("Identity not authorized"); } + else if (m_httpStatus == HTTP_CONFLICT) + { + m_mpinStatus.SetStatusCode(Status::CLIENT_SECRET_EXPIRED); + m_mpinStatus.SetErrorMessage("Client secret expired"); + } break; } http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-core/blob/fbb695cd/src/mpin_sdk.h ---------------------------------------------------------------------- diff --git a/src/mpin_sdk.h b/src/mpin_sdk.h index 37aa636..6785143 100644 --- a/src/mpin_sdk.h +++ b/src/mpin_sdk.h @@ -128,6 +128,7 @@ public: HTTP_SERVER_ERROR, // Remote error, that was not reduced to one of the above - the remote server returned internal server error status (5xx) HTTP_REQUEST_ERROR, // Remote error, that was not reduced to one of the above - invalid data sent to server, the remote server returned 4xx error status BAD_USER_AGENT, // Remote error - user agent not supported + CLIENT_SECRET_EXPIRED, // Remote error - re-registration required because server master secret expired }; Status(); @@ -285,6 +286,7 @@ private: static const int HTTP_FORBIDDEN = 403; static const int HTTP_NOT_ACCEPTABLE = 406; static const int HTTP_REQUEST_TIMEOUT = 408; + static const int HTTP_CONFLICT = 409; static const int HTTP_GONE = 410; static const int HTTP_PRECONDITION_FAILED = 412;
