capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
223 stars 106 forks source link

I am not able to hide URL bar #239

Open jdpsah93 opened 9 months ago

jdpsah93 commented 9 months ago

Capacitor version:

Run npx cap doctor:

Latest Dependencies:

  @capacitor/cli: 5.4.1
  @capacitor/core: 5.4.1
  @capacitor/android: 5.4.1
  @capacitor/ios: 5.4.1

Installed Dependencies:

  @capacitor/cli: 4.3.0
  @capacitor/core: 4.3.0
  @capacitor/android: 4.3.0
  @capacitor/ios: 4.3.0

[success] iOS looking great! πŸ‘Œ

Library version:

OAuth Provider:

Your Plugin Configuration

{
    export const oAuthConfig = {
  oauth2Options: {
    appId: environment.clientId,
    authorizationBaseUrl: `${environment.authority}/oauth2/v2.0/authorize?prompt=login`,
    scope: 'user.read openid profile offline_access',
    accessTokenEndpoint: `${environment.authority}/oauth2/v2.0/token`,
    resourceUrl: 'https://graph.microsoft.com/v1.0/me/',
    responseType: 'code',
    pkceEnabled: true,
    logsEnabled: true,
    web: {
      redirectUrl: environment.redirectUriWeb,
      windowOptions: 'height=600,left=0,top=0'
    },
    android: {
      redirectUrl: environment.redirectUri,
      additionalParameters: {
        location: 'yes',
        clearcache: 'yes',
        clearsessioncache: 'yes',
        hidenavigationbuttons: 'yes',
        hideurlbar: 'yes',
        fullscreen: 'yes',
        zoom: 'no'
      }
    },
    ios: {
      pkceEnabled: true,
      redirectUrl: environment.redirectUri
    }
  },
  oauth2RefreshOptions: {
    appId: environment.clientId,
    accessTokenEndpoint: `${environment.authority}/oauth2/v2.0/token`,
    refreshToken: '',
    scope: 'user.read openid profile offline_access'
  },
  logoutBaseUrl: `${environment.authority}/oauth2/v2.0/logout?post_logout_redirect_uri=${environment.postLogoutRedirectUri}&client_id=${environment.clientId}`
};
}

Affected Platform(s):

Expected Behavior

URL bar with share button should be hidden for security purpose while running in native device. Screenshot_20231003-201747

Sample Code or Sample Application Repo

Reproduction Steps

Other Information

moberwasserlechner commented 8 months ago

As far as I can tell, this was never possible. Even on the latest version of the lib I get the address bar e.g. for Google auth. I myself have no time to do this feature request in 2023 but I'm happy to accept a PR

moberwasserlechner commented 7 months ago

Duplicates #244