src/Module/Authentication/OAuth.php
protected function isValidCallback(Request $httpRequest)
    {
        return $this->session->has("provider")
            && $httpRequest->query->has("state")
            && $this->session->has("oauth2state")
            && is_string($this->session->get("oauth2state"))
            && (strlen($this->session->get("oauth2state")) > 0);
    }
protected function isValidCallback(Request $httpRequest)
    {
        return $this->session->has("provider")
            && $httpRequest->query->has("state")
            && $this->session->has("oauth2state")
            && is_string($this->session->get("oauth2state"))
            && (strlen($this->session->get("oauth2state")) > 0);
    }
Checks if the request and session have all the required fields for a OAuth 2.0 callback

- The session must have "provider" name which is the provider the callback
would be returned from.
- The request must have "state" query param as a CSRF prevention.
- The session must have "oauth2state" which must be a string
a must be non-empty.

@param Request $httpRequest
@return bool true if the required fields are present, false otherwise