Returns a pyalveo.OAuth2 given a json string built from the oauth.to_json() method.

def from_json(json_data):
        """
            Returns a pyalveo.OAuth2 given a json string built from the oauth.to_json() method.
        """
        #If we have a string, then decode it, otherwise assume it's already decoded
        if isinstance(json_data, str):
            data = json.loads(json_data)
        else:
            data = json_data
        oauth_dict = {
                      'client_id':data.get('client_id',None),
                      'client_secret':data.get('client_secret',None),
                      'redirect_url':data.get('redirect_url',None),
                      }
        oauth = OAuth2(api_url=data.get('api_url',None), api_key=data.get('api_key',None),oauth=oauth_dict, verifySSL=data.get('verifySSL',True))
        oauth.token = data.get('token',None)
        oauth.state = data.get('state',None)
        oauth.auth_url = data.get('auth_url',None)
        return oauth