2021年3月20日星期六

Custom Scopes: Using angular-oauth2-oidc with Auth0 and Github

I am attempting to integrate the angular-oauth2-oidc library with Auth0 and Github. Feel free to keep in mind I have selected all scopes(just to be safe), from the Auth0/Github UI side of things.

Using Latest Features

I am using the latest features that angular-oauth2-oidc has to offer.

  1. For instance, I am using code flow i.e.:
responseType: 'code',  
  1. In addition, I am using the proper audience for my customQueryParams e.g.
customQueryParams: {      // API identifier configured in Auth0 - Put made up audience here      audience: 'https://dev-51246k0z.us.auth0.com/api/v2/',    },  

Custom Scope Issue I am Coming Across

The issue I am coming across is that the custom scope I am specifying for roles is not coming through using the Auth0 Github Social Connection. My scope field looks like this:

// Scopes ("rights") the Angular application wants get delegated  scope: 'openid profile email offline_access read:roles',  

, but the access_token will never include scopes beyond openid profile email offline_access. I.e. will not give the app the scope/permissions for read:roles causing the Auth0 roles API to fail.

  • My Github social login is working. The app re-directs me to Github, where it asks me to log in, and then specifies the scopes the Github app wants.

  • If this question is not clear enough, feel free to comment, and will tidy the question up.

https://stackoverflow.com/questions/66727836/custom-scopes-using-angular-oauth2-oidc-with-auth0-and-github March 21, 2021 at 08:39AM

没有评论:

发表评论