def validate_realm(self, client_key, access_token, uri=None, required_realm=None):

        if not required_realm:
            return True

        # insert other check, ie on uri here

        client = Client.find_one({'client_key':client_key})
        
        if client:
            token = AccessToken.find_one(
                {'token':access_token, 'client_id': client['_id']})
            
            if token:
                return token['realm'] in required_realm
        
        return False
dataset/ETHPy150Open ib-lundgren/flask-oauthprovider/examples/mongo_demoprovider/provider.py/ExampleProvider.validate_realm/original