Invalid response mode when signing in with Apple

I want to implement apple sign in and receive query parameter on the redirect url.

I follow this guide to implement apple sign in
https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms

And I am redirected to this url for signing in.
https://appleid.apple.com/auth/authorize?client_id=[client_id]&redirect_uri=[redirect_url]&response_type=code%20id_token&response_mode=query&state=[state]

After opening the url, I receive an error with error code "invalid_request", and error message "Invalid response mode". If response mode is removed, it works. However, query should be a valid option.

Any help is appreciated. Thank you.
Answered by DTS Engineer in 633795022
The error is returned because you are requesting a code and id_token response type. When requesting an id_token response type, response_mode must be either fragment or form_post; using query as a response_mode in this case is invalid.

This restriction is mentioned on the same documentation posted above, titled Incorporating Sign in with Apple Into Other Platforms

response_type
(Required) The type of response requested. Valid values are code and id_token. You can request one or both. When requesting an id_token response type, response_mode must be either fragment or form_post.

Please let me know if the information above does not resolve your issue(s).
Accepted Answer
The error is returned because you are requesting a code and id_token response type. When requesting an id_token response type, response_mode must be either fragment or form_post; using query as a response_mode in this case is invalid.

This restriction is mentioned on the same documentation posted above, titled Incorporating Sign in with Apple Into Other Platforms

response_type
(Required) The type of response requested. Valid values are code and id_token. You can request one or both. When requesting an id_token response type, response_mode must be either fragment or form_post.

Please let me know if the information above does not resolve your issue(s).
Thank you very much ppinkney!
Your information is helpful and I eventually use type "fragment" to solve the problem.
Invalid response mode when signing in with Apple
 
 
Q