SijuKJ / desktopoauth2.0

MIT License
5 stars 2 forks source link

Support multiple organizations ??? #6

Closed vvinh4 closed 5 months ago

vvinh4 commented 6 months ago

The application has many different organizations, and I want to pass the above org like the way flutter_appauth is doing. Can you guys help with this? I am using the library for Flutter Windows App.

final request = AuthorizationTokenRequest( config.clientId, config.callbackSchema, scopes: config.scopes, clientSecret: config.clientSecret, promptValues: ['login'], serviceConfiguration: AuthorizationServiceConfiguration( authorizationEndpoint: config.authorizeUrl, tokenEndpoint: config.tokenUrl, endSessionEndpoint: config.endSessionUrl, ), additionalParameters: config.getLoginAdditionalParameters( deviceToken: deviceToken, culture: cultureArgs.join('-'), ), issuer: config.identityEndPoint, preferEphemeralSession: false, );

` Map<String, String> getLoginAdditionalParameters({ String? deviceToken, String? culture, }) { final parameters = { 'organization': organization, 'deviceToken': deviceToken ?? '', 'applicationCode': Platform.isAndroid ? 'Android' : '', };

if (culture?.isNotEmpty ?? false) {
  parameters.putIfAbsent('culture', () => culture ?? '');
}

return parameters;

}`

SijuKJ commented 5 months ago

Custom parameter appending feature is added. Please find new update.

vvinh4 commented 5 months ago

Thanks, team!