MaikuB / MaikuB/flutter_appauth

Question: Support for 'code id_token' as response_type in AuthorizationTokenRequest

Open
#418 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
308
Forks
301
Avg merge
2d 11h
Merged PRs (30d)
5

Description

Hello,

I have been using the Flutter AppAuth library for implementing OAuth2/OpenID Connect authentication in my app, and I encountered an issue when trying to use the 'code id_token' response_type.

Currently, it seems that the library defaults to the 'code' response_type. The native libraries seem to support using "code id_token" as response_type for the authorization request. However, in my use case, I need the response_type to be 'code id_token'. When I tried to modify the URL manually and used 'code id_token' in the browser, the authentication flow worked correctly. But with the current implementation of the library, I couldn't find a way to set the response_type as 'code id_token'. Is there a way to get the url generated by the library maybe?

Could you please guide me on how to set the response_type to 'code id_token' using the AuthorizationTokenRequest class in the library? If it's not currently supported, I kindly request you to consider adding this feature, as it would be helpful for developers who need to use different response types in their OAuth2/OpenID Connect implementations.

Here's a snippet of my current implementation:

```
final authorizationTokenRequest = AuthorizationTokenRequest(
Configuration.auth0ClientId,
Configuration.authRedirectUri,
issuer: Configuration.authIssuer,
clientSecret: Configuration.authClientSecret,
scopes: scopes2,
nonce: nonce,
promptValues: ['login'],
//ideally responseType: 'code id_token',
);
final AuthorizationTokenResponse? result =
await appAuth.authorizeAndExchangeCode(authorizationTokenRequest);
```

I tried setting the responseMode variable to 'code id_token' but it seems to be irrelevant.

Thank you for your time and your work on this library. Looking forward to hearing your suggestions.

Best regards,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with AuthorizationTokenRequest and the authorizeAndExchangeCode flow, then inspect how the authorization URL is generated and how responseMode is handled. Confirm whether a configurable response_type can pass through to the native AppAuth libraries, and verify that the resulting request uses `code id_token`.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter, ios
Domain
authentication, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.