'Decode state and return param.
:param str state:
state parameter passed through by provider
:param str param:
key to query from decoded state variable. Options include \'csrf\'
and \'user_state\'.
:returns:
string value from decoded state'

@classmethod
def decode_state(cls, state, param='user_state'):

    if (state and cls.supports_user_state):
        return json.loads(base64.urlsafe_b64decode(unquote(str(state))).decode('utf-8'))[param]
    else:
        return (state if (param == 'csrf') else '')
