GithubHelp home page GithubHelp logo

azure-samples / ms-identity-javascript-angular-spa-dotnetcore-webapi-roles-groups Goto Github PK

View Code? Open in Web Editor NEW
24.0 34.0 10.0 589 KB

Angular single-page application (SPA) calling .NET Core web API using App Roles and Security Groups for Implementing Role-Based Access Control (RBAC) using MSAL Angular

PowerShell 61.47% C# 13.27% JavaScript 1.53% TypeScript 19.11% CSS 0.80% HTML 3.81%
msal-js msal-angular rbac implicit-flow azure-ad graph-api microsoft-identity-platform

ms-identity-javascript-angular-spa-dotnetcore-webapi-roles-groups's Introduction

ms-identity-javascript-angular-spa-dotnetcore-webapi-roles-groups's People

Contributors

acxmatos avatar derisen avatar jennyf19 avatar jmprieur avatar kalyankrishna1 avatar markrullo avatar microsoft-github-operations[bot] avatar microsoftopensource avatar pmaytak avatar ralacher avatar shama-k avatar shivamtawari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ms-identity-javascript-angular-spa-dotnetcore-webapi-roles-groups's Issues

Is a client_secret needed to run the SPA example and where to get it?

Library

Description

I been following the instruction to run the example from chapter 1. But I keep getting error below when trying to login. It seem that I'm missing a setting for the client_secret, where would I get that and where does it need to be entered? I only see the setting in the appsettings.json in the API.

claims: "{"access_token":{"capolids":{"essential":true,"values":["29ab2b01-4103-4857-b082-bbd11047e33b"]}}}"
correlation_id: "af402f90-a33d-42aa-a1de-ecdf57ddd62c"
error: "invalid_client"
error_codes: [7000218]
0: 7000218
error_description: "AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.
↵Trace ID: 718bbd59-3d47-480c-820b-8be8fc8c9400
↵Correlation ID: af402f90-a33d-42aa-a1de-ecdf57ddd62c
↵Timestamp: 2021-03-26 19:07:05Z"
error_uri: "https://login.microsoftonline.com/error?code=7000218"
timestamp: "2021-03-26 19:07:05Z"
trace_id: "718bbd59-3d47-480c-820b-8be8fc8c9400"

Slight documentation tweak - TaskUser vs TaskUsers

Hello,
I think there is an error in the Chapter1 sample ReadMe.md . It states to add this to the manifest

      {
         "allowedMemberTypes": [
            "User"
         ],
         "description": "Users can read and modify their TodoList but cannot see others' lists",
         "displayName": "TaskUsers",
         "id": "a816142a-2e8e-46c4-9997-f984faccb625",
         "isEnabled": true,
         "lang": null,
         "origin": "Application",
         "value": "TaskUsers"
      }

In the code it checks for the singular TaskUser where the role added is the plural TaskUsers. Once I changed the manifest to the singular, things worked out. I'd make the change in the readme.md, but I've never made an open source contribution before. I'm not exactly sure how to do it correctly.

Chapter 1 TodoListSPA source code fails to build

Please follow the issue template below. Failure to do so will result in a delay in answering your question.

Library

  • "@azure/msal-angular": "^2.0.0-alpha.0"

Framework

Description

These lines throw an error:
this.authService.loginPopup({...this.msalGuardConfig.authRequest})
this.authService.loginRedirect({...this.msalGuardConfig.authRequest});

Error Message

error TS2345: Argument of type '{ prompt?: string | undefined; state?: string | undefined; authority?: string | undefined; correlationId?: string | undefined; claims?: string | undefined; resourceRequestMethod?: string | undefined; ... 10 more ...; scopes?: string[] | undefined; } | { ...; }' is not assignable to parameter of type 'PopupRequest | undefined'.
Type '{ prompt?: string | undefined; state?: string | undefined; authority?: string | undefined; correlationId?: string | undefined; claims?: string | undefined; resourceRequestMethod?: string | undefined; ... 10 more ...; scopes?: string[] | undefined; }' is not assignable to type 'PopupRequest'.
Type '{ prompt?: string | undefined; state?: string | undefined; authority?: string | undefined; correlationId?: string | undefined; claims?: string | undefined; resourceRequestMethod?: string | undefined; ... 10 more ...; scopes?: string[] | undefined; }' is not assignable to type '{ scopes: string[]; }'.
Types of property 'scopes' are incompatible.
Type 'string[] | undefined' is not assignable to type 'string[]'.
Type 'undefined' is not assignable to type 'string[]'.

Security

  • Is this issue security related?

Regression

  • Did this behavior work before?

Version:

MSAL Configuration

// Provide configuration values here.
// For Azure B2C issues, please include your policies.

Reproduction steps

Download TodoListSPA
npm install
ng build --prod

// Provide relevant code snippets here.
// For Azure B2C issues, please include your policies.

Expected behavior

The source code would build successfully

Browsers/Environment

  • Chrome
  • Firefox
  • Edge
  • Safari
  • IE
  • Other (Please add browser name here)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.