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

Compability with Ionic 4 - Angular 8 PWA #1366

Closed
1 of 5 tasks
dadeleac opened this issue Mar 12, 2020 · 2 comments
Closed
1 of 5 tasks

Compability with Ionic 4 - Angular 8 PWA #1366

dadeleac opened this issue Mar 12, 2020 · 2 comments
Labels
compatibility Related to compatibility with specific frameworks, environments, browsers, etc. msal-angular Related to @azure/msal-angular package question Customer is asking for a clarification, use case or information.

Comments

@dadeleac
Copy link

dadeleac commented Mar 12, 2020

Library

  • msal@1.x.x or @azure/msal@1.x.x
  • @azure/msal-browser@2.x.x
  • @azure/msal-angular@0.x.x
  • @azure/msal-angular@1.x.x
  • @azure/msal-angularjs@1.x.x

Description

Is it possible to use MSAL in a PWA project with Angular 8 and Ionic 4?

In localhost it works, but we deployed in Azure and when we integrated the packages "@angular/pwa" and "@angular/service-worker" we found the following error:

ERROR AuthorityUriInsecure

ERROR AuthorityUriInsecure
xr @ main-es2015.21335d84110bb0287b8f.js:1
handleError @ main-es2015.21335d84110bb0287b8f.js:1
next @ main-es2015.21335d84110bb0287b8f.js:1
r @ main-es2015.21335d84110bb0287b8f.js:1
__tryOrUnsub @ main-es2015.21335d84110bb0287b8f.js:1
next @ main-es2015.21335d84110bb0287b8f.js:1
_next @ main-es2015.21335d84110bb0287b8f.js:1
next @ main-es2015.21335d84110bb0287b8f.js:1
next @ main-es2015.21335d84110bb0287b8f.js:1
emit @ main-es2015.21335d84110bb0287b8f.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
invoke @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
run @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
runOutsideAngular @ main-es2015.21335d84110bb0287b8f.js:1
onHandleError @ main-es2015.21335d84110bb0287b8f.js:1
handleError @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
runTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
invokeTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
invoke @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
n.args.<computed> @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
setTimeout (async)
a @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
onScheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleMacroTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
u @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
(anonymous) @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
s.<computed> @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
r @ main-es2015.21335d84110bb0287b8f.js:1
error @ main-es2015.21335d84110bb0287b8f.js:1
_error @ main-es2015.21335d84110bb0287b8f.js:1
error @ main-es2015.21335d84110bb0287b8f.js:1
_error @ main-es2015.21335d84110bb0287b8f.js:1
error @ main-es2015.21335d84110bb0287b8f.js:1
_error @ main-es2015.21335d84110bb0287b8f.js:1
error @ main-es2015.21335d84110bb0287b8f.js:1
_error @ main-es2015.21335d84110bb0287b8f.js:1
error @ main-es2015.21335d84110bb0287b8f.js:1
_tryNext @ main-es2015.21335d84110bb0287b8f.js:1
_next @ main-es2015.21335d84110bb0287b8f.js:1
next @ main-es2015.21335d84110bb0287b8f.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
_trySubscribe @ main-es2015.21335d84110bb0287b8f.js:1
subscribe @ main-es2015.21335d84110bb0287b8f.js:1
call @ main-es2015.21335d84110bb0287b8f.js:1
subscribe @ main-es2015.21335d84110bb0287b8f.js:1
call @ main-es2015.21335d84110bb0287b8f.js:1
subscribe @ main-es2015.21335d84110bb0287b8f.js:1
call @ main-es2015.21335d84110bb0287b8f.js:1
subscribe @ main-es2015.21335d84110bb0287b8f.js:1
call @ main-es2015.21335d84110bb0287b8f.js:1
subscribe @ main-es2015.21335d84110bb0287b8f.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
invoke @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
onInvoke @ main-es2015.21335d84110bb0287b8f.js:1
invoke @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
run @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
(anonymous) @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
invokeTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
onInvokeTask @ main-es2015.21335d84110bb0287b8f.js:1
invokeTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
runTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
_ @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
Promise.then (async)
g @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
onScheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
scheduleMicroTask @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
E @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
then @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
appInitializer @ main-es2015.21335d84110bb0287b8f.js:1
runInitializers @ main-es2015.21335d84110bb0287b8f.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
invoke @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
onInvoke @ main-es2015.21335d84110bb0287b8f.js:1
invoke @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
run @ polyfills-es2015.4bfc7c3662b332ccaf07.js:1
run @ main-es2015.21335d84110bb0287b8f.js:1
bootstrapModuleFactory @ main-es2015.21335d84110bb0287b8f.js:1
zUnb @ main-es2015.21335d84110bb0287b8f.js:1
r @ runtime-es2015.e08c6461a11bdde933ba.js:1
0 @ main-es2015.21335d84110bb0287b8f.js:1
r @ runtime-es2015.e08c6461a11bdde933ba.js:1
c @ runtime-es2015.e08c6461a11bdde933ba.js:1
a @ runtime-es2015.e08c6461a11bdde933ba.js:1
(anonymous) @ main-es2015.21335d84110bb0287b8f.js:1
Show 34 more frames

Our code is as follows:

app.module.ts

    MsalModule.forRoot({
      clientID: environment.authClientID,
      authority: environment.authAuthority,
      redirectUri: environment.authRedirectUri,
      validateAuthority : true,
      cacheLocation : "localStorage",
      storeAuthStateInCookie: false, 
      postLogoutRedirectUri: environment.authPostLogoutRedirectUri,
      navigateToLoginRequestUrl: true,
      popUp: false,
      logger: loggerCallback,
      level: LogLevel.Info,
      piiLoggingEnabled: true,
      consentScopes: [environment.authApiScope],
      protectedResourceMap: protectedResourceMap
    }),
    ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })

app-routing.module.ts:

const routes: Routes = [
  {
    path: "",
    redirectTo: "home",
    pathMatch: "full",
    canActivate: [MsalGuard]
  },
@dadeleac dadeleac added the question Customer is asking for a clarification, use case or information. label Mar 12, 2020
@DarylThayil DarylThayil added msal-angular Related to @azure/msal-angular package compatibility Related to compatibility with specific frameworks, environments, browsers, etc. labels Mar 25, 2020
@jasonnutter
Copy link
Contributor

@dadeleac I don't believe the AuthorityUriInsecure error is from our library. Are you using another library for authentication? Quick search leads me to believe the redirect uri you are setting is not https, can you verify that?

And Ionic + @angular/pwa is not a scenario we have tested.

@jasonnutter
Copy link
Contributor

Closing due to inactivity, let us know if you have further questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compatibility Related to compatibility with specific frameworks, environments, browsers, etc. msal-angular Related to @azure/msal-angular package question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

3 participants