p2-inc / idp-wizard

Identity Provider setup wizards for Keycloak
https://phasetwo.io
Other
1 stars 1 forks source link

add cloud mode endpoints to all protocol wizards #106

Closed xgp closed 2 years ago

jeffpatzer commented 2 years ago

@xgp One thing I haven't accounted for just yet:

Important note in the confirmation step when we create IdPs in cloud mode. The alias you provide, will not be used . You will need to look in the Location response header to get the generated alias. This is to prevent collisions, because multiple organizations will be using the wizard in the same realm at the same time. I can’t rely on the random string generated on the frontend, so I have to generate it and check for duplicates on the backend.

Which call is this supposed to be in?

xgp commented 2 years ago

@jeffpatzer When we create the IdentityProvider, we need to note the new alias from the Location response header, so that we can then use it in the creation of the IdentityProviderMapper.

xgp commented 2 years ago

Reopening to track cloud alias -> IdentityProviderMapper

jeffpatzer commented 2 years ago

Running into a 404 issue with the import-config endpoint.

image

Payload

{"fromUrl":"https://login.microsoftonline.com/74df8381-4935-4fa8-8634-8e3413f93086/federationmetadata/2007-06/federationmetadata.xml?appid=ba149e64-4512-440b-a1b4-ae976d85f1ec","providerId":"saml","realm":"cloud"}

Am I missing something in the request? The request URL seems to follow this pattern as expected https://github.com/p2-inc/idp-wizard/issues/83#issuecomment-1105684702

POST /:realm/orgs/:orgId/idps/import-config https://app.phasetwo.io/auth/admin/realms/cloud/orgs/5e2288c5-1867-4e13-9b35-824be46fa5cc/idps/import-config

xgp commented 2 years ago

It's the correct format. A 404 implies it can't find the org. I wasn't able to repro locally, and the test I have written for this works fine. I need to dive into why it's not working in prod. In the meantime, if you try to call the onprem import-config endpoint with the token generated for the org, does it work?