Giter Club home page Giter Club logo

Comments (8)

theborakompanioni avatar theborakompanioni commented on August 16, 2024 1

Not so fast @straumat! : -)

Maybe it is not the correct approach to throw AuthenticationException or AuthenticationServiceException.
It might be that SessionAuthenticationException is better or not throwing an exception at all!
I will read into it and close the ticket only when a suitable solution has been found!

Thank you @straumat 🙏
You really help me a lot with your insights!

from bitcoin-spring-boot-starter.

straumat avatar straumat commented on August 16, 2024 1

Ok! it now works!

from bitcoin-spring-boot-starter.

theborakompanioni avatar theborakompanioni commented on August 16, 2024

Hey @straumat!

I was wondering why the browser does not poll with the same k1 value as seen in your logs..

The problem is in your exception handling:

// If the user is not authenticated when accessing a protected page, redirect to the login page.
.exceptionHandling((exceptionHandling) -> exceptionHandling
        .accessDeniedPage(ERROR_403_PAGE)
        .authenticationEntryPoint((request, response, authenticationException) -> response.sendRedirect(LNURL_AUTH_LOGIN_PAGE_PATH))
)

When a user polls the session migration endpoint, it will throw an exception if the user has not been paired with a linking key.
In your setup, this will "redirect" the user to the login page again, creating a new k1, repeating this over and over again.

I do not know if the session migration endpoint breaks any spring-security contracts by throwing an exception.. maybe it should just return an error by returning a proper http status? What do you think?

from bitcoin-spring-boot-starter.

straumat avatar straumat commented on August 16, 2024

Hi :) Ok, I had a bug in findPairedLinkingKeyByK1, it works now, I can log in :) Thx !
I will move to the new pairK1WithLinkingKey and write the blog post.
You can close this issue and thx again

from bitcoin-spring-boot-starter.

straumat avatar straumat commented on August 16, 2024

For information, with the develop release, this doesn't work anymore:

// If the user is not authenticated when accessing a protected page, redirect to the login page.
.exceptionHandling((exceptionHandling) -> exceptionHandling
        .accessDeniedPage(ERROR_403_PAGE)
        .authenticationEntryPoint((request, response, authenticationException) -> response.sendRedirect(LNURL_AUTH_LOGIN_PAGE_PATH))
)

from bitcoin-spring-boot-starter.

theborakompanioni avatar theborakompanioni commented on August 16, 2024

For information, with the develop release, this doesn't work anymore:

// If the user is not authenticated when accessing a protected page, redirect to the login page.
.exceptionHandling((exceptionHandling) -> exceptionHandling
        .accessDeniedPage(ERROR_403_PAGE)
        .authenticationEntryPoint((request, response, authenticationException) -> response.sendRedirect(LNURL_AUTH_LOGIN_PAGE_PATH))
)

What do you mean, it does not work anymore?

from bitcoin-spring-boot-starter.

straumat avatar straumat commented on August 16, 2024

with 0.12, I could login with that code.
with develop, i have to comment to login

from bitcoin-spring-boot-starter.

theborakompanioni avatar theborakompanioni commented on August 16, 2024

with 0.12, I could login with that code. with develop, i have to comment to login

Hmm.. I do not think so.. it should have never worked -> #116 (comment)

from bitcoin-spring-boot-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.