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

Too many redirects after login #19131

Closed
drhae opened this issue Feb 10, 2021 · 12 comments
Closed

Too many redirects after login #19131

drhae opened this issue Feb 10, 2021 · 12 comments
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-aad-b2c Spring active directory b2c related issues. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@drhae
Copy link

drhae commented Feb 10, 2021

Hello. I am trying to get this sample to run as a war file on a server instead of as a jar. When I deploy it though, it will prompt for the b2c login, then get caught in a redirect loop until it fails.

To change it to deploy as war file i did these steps:
1 changed packaging in pom to war
2 added exclusion under spring boot starter web

 <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
         <exclusion>
           <artifactId>spring-boot-starter-tomcat</artifactId>
           <groupId>org.springframework.boot</groupId>
         </exclusion>
       </exclusions>
   </dependency>

3 added dependancy for javax serlvet

<dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
  </dependency>

4 Changed the application class to extend SpringBootServletInitializer

@SpringBootApplication
public class AzureADB2COIDCSampleApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {       
        SpringApplication.run(AzureADB2COIDCSampleApplication.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AzureADB2COIDCSampleApplication.class);
    }
}

Any ideas why this would fail when deployed that way but work fine when running through ide as jar file?

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 10, 2021
@joshfree joshfree added the azure-spring All azure-spring related issues label Feb 11, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 11, 2021
@joshfree
Copy link
Member

@jialindai could you please assist?

@chenrujun chenrujun assigned chenrujun and unassigned jialindai Feb 18, 2021
@chenrujun chenrujun added the azure-spring-aad-b2c Spring active directory b2c related issues. label Feb 18, 2021
@backwind1233 backwind1233 self-assigned this Feb 19, 2021
@backwind1233
Copy link
Contributor

Hi, @drhae
I tried to reproduce the problem you have met, but it seems to work for me.

The only difference when I deploy the sample as war is that I added a maven
dependency

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
      <scope>provided</scope>
    </dependency>

the sample code I used is of the current master branch

image

My yaml config is like this:

azure:
  activedirectory:
    b2c:
      base-uri: ${your-tenant-authorization-server-base-uri}
      client-id: ${your-client-id}
      client-secret: ${your-client-secret}
      logout-success-url: ${your-logout-success-url}
      user-name-attribute-name: ${your-user-name-claim}
      user-flows:
        sign-up-or-sign-in: ${your-sign-up-or-in-user-flow}
        profile-edit: ${your-profile-edit-user-flow}     # optional
        password-reset: ${your-password-reset-user-flow} # optional

Could you please try it again?
Please give more information (eg: commit id) if you still fail to deploy the war.

@drhae
Copy link
Author

drhae commented Feb 19, 2021 via email

@chenrujun chenrujun assigned chenrujun and unassigned chenrujun Feb 19, 2021
@jialindai jialindai added the Client This issue points to a problem in the data-plane of the library. label Feb 20, 2021
@backwind1233
Copy link
Contributor

hi @joshfree
It seems your reply-url is not correct,
you need to make sure that the replay-url is the same as you configured in the portal.
maybe you can just remove this line here,
if it doesn't work, please make sure the replay-url is the same as you configure

@chenrujun chenrujun changed the title [BUG]- Too many redirects after login Too many redirects after login Feb 22, 2021
@drhae
Copy link
Author

drhae commented Feb 24, 2021

The reply url is the same in the azure portal as what is in the properties file. Just sits and loops..
Also, the sample you are using is using version 3.2.0 of the azure-spring-boot-starter-active-directory-b2c which is not available ? i had to use 3.1.0 as that is newest one avail to download.

@backwind1233
Copy link
Contributor

@drhae
hi, could you please check your step with this MD file?
try to use another url as your replay-url, also make sure your reply-url is different with logout-success-url.

@drhae
Copy link
Author

drhae commented Mar 1, 2021 via email

@backwind1233
Copy link
Contributor

@drhae
hi, can you run the war file on your local machine,
If you are using chrome, maybe you can open click F12 to open Chrome DevTools to see the response.
if the authentication loops, please give some detailed messages about the request and response.

@drhae
Copy link
Author

drhae commented Mar 2, 2021 via email

@ZhuXiaoBing-cn
Copy link
Contributor

ZhuXiaoBing-cn commented Mar 3, 2021

Hi, @drhae
Could you please send a screenshot of the reply url on the portal? From your log, I noticed that the reply url you sent in your redirect request was not the same as in your application.yaml file. We need to further ensure that the reply url in the application.yaml file is the same as on the portal.

@drhae
Copy link
Author

drhae commented Mar 3, 2021 via email

@yiliuTo
Copy link
Member

yiliuTo commented Mar 19, 2021

Closing this issure because no response from the customer. If you have any problems, please open again.

@yiliuTo yiliuTo closed this as completed Mar 19, 2021
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this issue Jun 23, 2022
Mitryakh/network 2022 01 01 (Azure#19412)

* Adds base for updating Microsoft.Network from version stable/2021-08-01 to version 2022-01-01

* Updates readme

* Updates API version in new specs and examples

* Updated Explicit proxy settings by adding one boolean field to it (Azure#19011)

* API for provider port (Azure#19041)

* Update readme.md

* Create expressRouteProviderPort.json

* Create expressRouteProviderPortList.json

* Create expressRouteProviderPort.json

* Update custom-words.txt

* Update expressRouteProviderPort.json

* Update expressRouteProviderPortList.json

* Update expressRouteProviderPort.json

* Add WAF match variable operators (Azure#18925)

### webapplicationfirewall.json
* Add GreaterThanOrEquals operator and Any operator to custom rule
  match conditions in WAF policy spec

* Add VirtualHub Router autoscale configuration (Azure#19131)

Co-authored-by: Andrii Kalinichenko <ankalini@microsoft.com>

* Adding rule priority to Tls Proxy routing rule object model (Azure#19135)

Co-authored-by: Vinay Mundada <vimundad@microsoft.com>

* swagger changes for new ssl policies (Azure#19183)

* Update Swagger Spec for VMSS Packet Capture (Azure#19202)

* Update Swagger Spec for VMSS Packet Capture

* Remove extra line

* Update Swagger spec for Connection Monitor VMSS (Azure#19203)

* Adding new endpoint in ConnectionMonitor

* Changing ConnectionMonitor endpoints order

* Add flushConnection to NSG (Azure#19085)

* Merge NetworkManger into 2022-01-01 (Azure#19169)

* Merge NetworkManger into 2022-01-01

* Remove EffectiveVnet APIs

* Remove SecurityUser Resource

* update readme

* Fix as comments

* fix as comments

* remove network group type

* Add new parameter noInternetAdvertise to CustomIPPrefix (Azure#19340)

* fix

* fix

Co-authored-by: Weiheng Li <weihl@microsoft.com>

* Route Server Integration feature swagger changes (Azure#19215)

* Route Server Integration feature swagger changes

* prettier run changes

* updating api version in examples file

* fixing test errors

* fixing test errors

* fixing modelvalidation errors

* fixing test errors

* fixing modelvalidation errors

* changes based on review comments

* fixing lintdiff failure

* updating examples

* update wrong enum value for customipprefix (Azure#19382)

* fix

* fix

* fix

Co-authored-by: Weiheng Li <weihl@microsoft.com>

* Updated ExplicitProxySettings to ExplicitProxy on Firewall Policy ver2022-01-01 (Azure#19299)

Co-authored-by: Gizachew Eshetie <v-geshetie@microsoft.com>

* Add resource type (Azure#19434)

Co-authored-by: Andrii Kalinichenko <ankalini@microsoft.com>

* Fix prettier errors (Azure#19462)

Co-authored-by: Andrii Kalinichenko <ankalini@microsoft.com>

Co-authored-by: uditmisra52 <103006702+uditmisra52@users.noreply.github.com>
Co-authored-by: jashsing-mic <79445297+jashsing-mic@users.noreply.github.com>
Co-authored-by: Anurag Kishore <kishore.1337.anurag@gmail.com>
Co-authored-by: AndriiKalinichenko <kalinichenkoandrew@gmail.com>
Co-authored-by: Andrii Kalinichenko <ankalini@microsoft.com>
Co-authored-by: Vinay Jayant Mundada <vinaymundada27@gmail.com>
Co-authored-by: Vinay Mundada <vimundad@microsoft.com>
Co-authored-by: kaushik-ms <103559254+kaushik-ms@users.noreply.github.com>
Co-authored-by: snagpal99 <95475229+snagpal99@users.noreply.github.com>
Co-authored-by: kumaam <102141910+kumaam@users.noreply.github.com>
Co-authored-by: Satya-anshu <70507845+Satya-anshu@users.noreply.github.com>
Co-authored-by: yanfa317 <53584318+yanfa317@users.noreply.github.com>
Co-authored-by: Weiheng Li <weihengli.tj@gmail.com>
Co-authored-by: Weiheng Li <weihl@microsoft.com>
Co-authored-by: Anchal Kapoor <ankapoo@microsoft.com>
Co-authored-by: Gizachew-Eshetie <gizchanie@gmail.com>
Co-authored-by: Gizachew Eshetie <v-geshetie@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues azure-spring-aad-b2c Spring active directory b2c related issues. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

7 participants