def METHOD_NAME(self, endpoint_cls=None, metadata=None):
    app = self.app
    server = create_authorization_server(app)
    if endpoint_cls:
        server.register_endpoint(endpoint_cls)
    else:
        class MyClientRegistration(ClientRegistrationEndpoint):
            def get_server_metadata(self):
                return metadata
        server.register_endpoint(MyClientRegistration)
    @app.route('/create_client', methods=['POST'])
    def create_client():
        return server.create_endpoint_response('client_registration')
    user = User(username='foo')
    db.session.add(user)
    db.session.commit()