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

Support for generic OIDC #63

Open
ktkk opened this issue Dec 6, 2024 · 0 comments
Open

Support for generic OIDC #63

ktkk opened this issue Dec 6, 2024 · 0 comments

Comments

@ktkk
Copy link

ktkk commented Dec 6, 2024

We use Firebase auth in conjunction with our own OIDC backend and this works somewhat ok with the firebase_auth package on Android and iOS. We are looking into this package now because our requirements changed and we need a Windows application for our users too.

I've tried implementing this myself by extending from ProviderArgs, but I can't get it to work.

class OAuthSignInArgs extends ProviderArgs {
  OAuthSignInArgs({
    required this.host,
    required this.path,
    required this.redirectUri,
    required this.clientId,
    this.scopes = const [],
    this.responseType = 'code',
    String? nonce,
  }) : nonce = nonce ?? generateNonce();

  @override
  final String host;

  @override
  final String path;

  @override
  final String redirectUri;

  final String clientId;
  final List<String> scopes;
  final String responseType;
  final String nonce;

  @override
  Map<String, String> buildQueryParameters() => {
        'response_type': responseType,
        'client_id': clientId,
        'scope': scopes.join(' '),
        'redirect_uri': redirectUri,
        'nonce': sha256.convert(utf8.encode(nonce)).toString(),
      };
}

I'd love to know what I'm doing wrong here. The callback url I get back from Firebase directs me to a page saying the following:

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared. Some specific scenarios are - 1) Using IDP-Initiated SAML SSO. 2) Using signInWithRedirect in a storage-partitioned browser environment.

Any feedback would be greatly appreciated!

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

1 participant