@classmethod
def expose_authentication_method(cls, method_name, definition):
    """Allow security extensions to expose authentication methods on the
        OpenAPI documentation. The definition field should correspond to a
        valid OpenAPI security definition. Refer the OpenAPI 2.0 specification
        for more information.
        https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

        Below are some examples for BasicAuth and OAuth2::

            {
                "type": "basic",
                "description" "My basicauth method."

            }

            {
                "type": "oauth2",
                "authorizationUrl": "https://oauth-stable.dev.lcip.org/v1",
                "flow": "implicit",
                "scopes": {"kinto": "Kinto user scope."}
            }

        """
    cls.security_definitions[method_name] = definition
    cls.security_roles[method_name] = definition.get('scopes', {}).keys()
