def post(self, *args, **kwargs): login_hint = None try: if self.application.settings["suspend_registration"]: self.render("public/jointeam.html", errors=None, suspend=True) else: code = self.get_argument("team-code", "") code = self.validate_teamcode(code) login_hint = self.get_argument("login-hint", None) if len(login_hint) == 0: login_hint = None code_flow = azuread_app.initiate_auth_code_flow( ["email"], redirect_uri=options.redirect_url, login_hint=login_hint ) code_flow["teamcode"] = code self.memcached.add(code_flow["state"], code_flow) self.redirect(code_flow["auth_uri"]) except ValidationError as error: self.render( "public/jointeam.html", errors=[str(error)], suspend=self.application.settings["suspend_registration"], login_hint=login_hint, )
def build_auth_code_flow(self): codeflow = azuread_app.initiate_auth_code_flow( ["email"], redirect_uri=options.redirect_url ) return codeflow