microsoft / azure-spring-boot

Spring Boot Starters for Azure services
MIT License
374 stars 460 forks source link

Need to add query parameter to b2c #960

Closed GarstMan78 closed 1 year ago

GarstMan78 commented 1 year ago

we have a custom ui that uses a &application query parameter how can i extend the sample project to make the yml support this

spring:
  cloud:
    azure:
      active-directory:
        b2c:
          enabled: true
          #base-uri: ***
          base-uri: ***
          credential:
            client-id: ***
            client-secret: "***"
          login-flow: sign-up-or-sign-in
          query-parameters:
            application: "/CustomUI"
          logout-success-url: https://asu-nonprod.cat.com/
          user-flows:
            sign-up-or-sign-in: b2c_1a_p2_v1_signin_dev
            profile-edit: b2c_1a_p2_v1_profileedit_dev
            password-reset: <your-password-reset-user-flow-name>
          user-name-attribute-name: ***
moarychan commented 1 year ago

Hi @GarstMan78 , thanks for using Spring Cloud Azure libs!

Could you try to rename your property query-parameters and use spring.cloud.azure.active-directory.authenticate-additional-parameters.application=CustomUI?

GarstMan78 commented 1 year ago

Hi @GarstMan78 , thanks for using Spring Cloud Azure libs!

Could you try to rename your property query-parameters and use spring.cloud.azure.active-directory.authenticate-additional-parameters.application=CustomUI?

@moarychan , Thank you very much This worked! Because i am using b2c i needed to use spring.cloud.azure.active-directory.b2c..authenticate-additional-parameters.application=CustomUI. Thank you so much. Did i miss this in documentation somewhere? Trying to learn as much as i can :)

moarychan commented 1 year ago

Awesome you! Please check the configuration from https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/spring-security-support?tabs=SpringCloudAzure4x#configuration-1