@@ -49,7 +49,7 @@ async def fastapi_client():
49
49
app = FastAPI ()
50
50
app .add_middleware (get_middleware ())
51
51
52
- return TestClient (app , raise_server_exceptions = False )
52
+ return TestClient (app , raise_server_exceptions = True )
53
53
54
54
55
55
async def test_thirdpary_parsing_works (fastapi_client : TestClient ):
@@ -268,3 +268,63 @@ async def test_signinup_works_when_validate_access_token_does_not_throw(
268
268
assert res .status_code == 200
269
269
assert access_token_validated is True
270
270
assert res .json ()["status" ] == "OK"
271
+
272
+
273
+ async def test_signinup_android_without_redirect_uri (
274
+ fastapi_client : TestClient , mocker : MockerFixture
275
+ ):
276
+ time = str (datetime .datetime .now ())
277
+ mocker .patch (
278
+ "supertokens_python.recipe.thirdparty.providers.custom.get_supertokens_user_info_result_from_raw_user_info" ,
279
+ return_value = UserInfo (
280
+ "" + time ,
281
+ UserInfoEmail (f"johndoeprovidertest+{ time } @supertokens.com" , True ),
282
+ RawUserInfoFromProvider ({}, {}),
283
+ ),
284
+ )
285
+ st_init_args = {
286
+ ** st_init_common_args ,
287
+ "recipe_list" : [
288
+ session .init (),
289
+ thirdpartyemailpassword .init (
290
+ providers = [
291
+ ProviderInput (
292
+ config = ProviderConfig (
293
+ third_party_id = "custom" ,
294
+ clients = [
295
+ ProviderClientConfig (
296
+ client_id = "test" ,
297
+ client_secret = "test-secret" ,
298
+ scope = ["profile" , "email" ],
299
+ client_type = "android" ,
300
+ ),
301
+ ],
302
+ authorization_endpoint = "https://example.com/oauth/authorize" ,
303
+ authorization_endpoint_query_params = {
304
+ "response_type" : "token" , # Changing an existing parameter
305
+ "response_mode" : "form" , # Adding a new parameter
306
+ "scope" : None , # Removing a parameter
307
+ },
308
+ token_endpoint = "https://example.com/oauth/token" ,
309
+ ),
310
+ )
311
+ ]
312
+ ),
313
+ ],
314
+ }
315
+ init (** st_init_args ) # type: ignore
316
+ start_st ()
317
+
318
+ res = fastapi_client .post (
319
+ "/auth/signinup" ,
320
+ json = {
321
+ "thirdPartyId" : "custom" ,
322
+ "clientType" : "android" ,
323
+ "oAuthTokens" : {
324
+ "access_token" : "accesstoken" ,
325
+ "id_token" : "idtoken" ,
326
+ },
327
+ },
328
+ )
329
+ assert res .status_code == 200
330
+ assert res .json ()["status" ] == "OK"
0 commit comments