Azure / Azure/static-web-apps

Error in developer tools when logging in to SWA with aadb2c

Open
#1,031 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Every time I login to our SWA with Azure B2C as provider I get this error in the developer tools:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'strict-dynamic' 'self' 'nonce-4v61r9Royh4j3hEMnW9z3Q==' 'report-sample'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

**Steps to reproduce the behavior:**
1. Authenticate/Authorize with Azure B2C as IDP
2. Use default signin flow with email / password
3. Go to the SWA
4. Provide credentials in the B2C login form
5. Press "Sign in"

**Expected behavior**
No error ;)

**Screenshots**
![2023-01-06 23_50_53](https://user-images.githubusercontent.com/7408674/211113325-ae3cd1fa-ab70-4817-a126-02d52c7b43ad.png)

**Device info (if applicable):**
Chrome browser
Edge browser

**Additional context**
The login succeeds, and _seem_ work: redirects to "/.auth/complete" then "/" succeed and "/.auth/me" populates the clientPrincipal
The SWA is javascript SPA / node API
This might be a B2C issue not related to SWA. In that case I would like a link to the appropriate issue tracker

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.