Skip to content

Commit a16a204

Browse files
authored
Fix flask app example (#445)
## Changes There have been some changes with the OAuth APIs since this example was written. I've cleaned this up a bit so that it works with the current SDK. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [ ] `make test` run locally - [ ] `make fmt` applied - [ ] relevant integration tests applied
1 parent 5fc77b0 commit a16a204

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

examples/flask_app_with_oauth.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,9 @@ def register_custom_app(oauth_client: OAuthClient, args: argparse.Namespace) ->
109109
password=getpass.getpass("Password: "),
110110
)
111111

112-
logging.info("Enrolling all published apps...")
113-
account_client.o_auth_enrollment.create(enable_all_published_apps=True)
114-
115-
status = account_client.o_auth_enrollment.get()
116-
logging.info(f"Enrolled all published apps: {status}")
117-
118112
custom_app = account_client.custom_app_integration.create(
119113
name=APP_NAME, redirect_urls=[f"http://localhost:{args.port}/callback"], confidential=True,
114+
scopes=["all-apis"],
120115
)
121116
logging.info(f"Created new custom app: "
122117
f"--client_id {custom_app.client_id} "
@@ -131,7 +126,7 @@ def init_oauth_config(args) -> OAuthClient:
131126
client_id=args.client_id,
132127
client_secret=args.client_secret,
133128
redirect_url=f"http://localhost:{args.port}/callback",
134-
scopes=["clusters"],
129+
scopes=["all-apis"],
135130
)
136131
if not oauth_client.client_id:
137132
client_id, client_secret = register_custom_app(oauth_client, args)

0 commit comments

Comments
 (0)