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

GetRoles hosted in azure app container #8

Open
ariggi-epam opened this issue Nov 22, 2022 · 2 comments
Open

GetRoles hosted in azure app container #8

ariggi-epam opened this issue Nov 22, 2022 · 2 comments

Comments

@ariggi-epam
Copy link

Hi,
I am hosting the back end in azure app container. I'm trying to host there the get roles api too.
Is that possible?
I tried with both v1 and v2 versions config for the azure active directory (see below) but i always get an empty request body.
I'm receiving an empty req.body. Do you know if it is possible?
Is it related to this?
Azure/static-web-apps#988

"auth": {
        "rolesSource": "/api/getroles",
        "identityProviders": {
          "azureActiveDirectory": {
            "registration": {
              "openIdIssuer": "https://login.microsoftonline.com/<tenantid>/v2.0",
              "clientIdSettingName": "AZURE_CLIENT_ID",
              "clientSecretSettingName": "AZURE_CLIENT_SECRET"
            },
            "login": {
              "loginParameters": [
                "scope=openid profile email https://graph.microsoft.com/User.Read"
              ]
            }
          }
        }
      }

and

"auth": {
        "rolesSource": "/api/getroles",
        "identityProviders": {
            "azureActiveDirectory": {
                "userDetailsClaim": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
                "registration": {
                    "openIdIssuer": "https://login.microsoftonline.com/<tenantid>",
                    "clientIdSettingName": "AZURE_CLIENT_ID",
                    "clientSecretSettingName": "AZURE_CLIENT_SECRET"
                },
                "login": {
                    "loginParameters": [
                        "resource=https://graph.microsoft.com"
                    ]
                }
            }
        }
    },
@ariggi-epam
Copy link
Author

I always get a request with and empty body and the following headers
host: 'album-api....centralus.azurecontainerapps.io',
traceparent: '00-bf53bb2eb02a33c27a2798dabed3e9df-..-00',
'x-ms-auth-token': 'Bearer eyJ..',
'x-forwarded-for': '20.84.233.8',
'x-envoy-external-address': '20.84.233.8',
'x-request-id': 'bc8a1083-444c-4569-8c74-..',
'x-envoy-expected-rq-timeout-ms': '1800000',
'x-k8se-app-name': 'album-api--...',
'x-k8se-app-namespace': 'k8se-apps',
'x-k8se-protocol': 'http1',
'x-k8se-app-kind': 'web',
'x-ms-containerapp-name': 'album-api',
'x-ms-containerapp-revision-name': 'album-api--...',
'x-arr-ssl': 'true',
'x-forwarded-proto': 'https',
'x-ms-client-principal-id': 'anonymous',
'x-ms-client-principal-idp': 'azureStaticWebApps',
'content-type': 'application/json; charset=utf-8',
'content-length': '3495'

The jwt has the api (the container app), instead of ms graph. I can't use it to call ms graph to obtain the aad groups.
Do you have any suggestions?

@ariggi-epam
Copy link
Author

Sorry, I meant the jwt has the api as audiences, instead of ms graph.
this is the content
{
"prn": "bnVsbA==",
"sub": "anonymous",
"iss": "https://nice-plant.....centralus.2.azurestaticapps.net/.auth",
"aud": "https://album-api......centralus.azurecontainerapps.io",
"nbf": 1669163333,
"exp": 1669163633,
"iat": 1669163333
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant