Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audience is taking an array, but I needed it to take one value as string. #12

Open
yashwp opened this issue Dec 30, 2020 · 2 comments
Open

Comments

@yashwp
Copy link

yashwp commented Dec 30, 2020

I have a situation, where I need to send the audience as String instead of List<String>. How can I do it, can you please share some workaround?

var claimSet = JwtClaim(
      issuer: issuer,
      subject: '',
      audience: [issuer],
      otherClaims: {'DATA': encodedPayload},
      maxAge: Duration(days: kReleaseMode ? 1 : 7),
 );

claimSet.audience = issuer; // Giving error - 'audience' can't be used as a setter because it's final.

I tried to update the audience key but IDE itself giving an error.

@tejainece
Copy link
Member

Why not use array with one entry in that case?

@tejainece
Copy link
Member

If that is not possible I will consider adding an anAudience field that will override audience if present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants