aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.33k stars 248 forks source link

Configure auth to handle SAML flow. #510

Closed mattRiddoch closed 1 year ago

mattRiddoch commented 3 years ago

Describe the bug We are currently using the flutter_web_auth plugin to present a ping fed webview. The url looks like so:

'https://XXXXXXXXXX.amazoncognito.com/oauth2/authorize?identity_provider=PingFedNonProd&redirect_uri=XXXXXX://auth/callback&response_type=TOKEN&client_id=XXXXXXXXXXXXXXX',
urlScheme: 'XXXXXXXXX',

We would love to have this configured in the "Auth" section of the amplifyconfiguration.dart file but am coming up short finding examples? This example looks close: Issue 431

Platform Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply): [] Android [X] iOS

drkhannah commented 3 years ago

We need the Flutter Amplify package to support our custom SAML login for both iOS and Android

drkhannah commented 3 years ago

(Bump) any response to this would be extremely helpful

drkhannah commented 3 years ago

(Bump) any response to this would be extremely helpful

drkhannah commented 3 years ago

@haverchuck does the feature-request mean this isn't currently supported?

srisaiswaroop commented 2 years ago

Any update on SAML support for flutter SDK?

Jordan-Nelson commented 2 years ago

I don't have an update on this issue, but if it is a feature you would like to see implemented, please give the issue a 👍 . It helps us to quickly gauge how much interest a feature request has.

dnys1 commented 1 year ago

This feature has been added in v1.0.0 of Amplify Flutter, which is now stable. To enable a SAML provider, follow the instructions in the Cognito docs for enabling Hosted UI and adding a SAML provider, then call signInWithWebUI using the name given during set up.

Future<void> _signInSaml() async {
  final result = await Amplify.Auth.signInWithWebUI(
    provider: const AuthProvider.saml('Keycloak-SAML'),
  );
  safePrint(result);
}

This release also includes web and desktop support for Auth, API, Analytics, and Storage. You can see the list of new features and bug fixes in the release notes, and see more details on how to migrate in the upgrade guide.