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

Redirect to login page when authentication on media page expires #170

Closed
Tracked by #1540
mahalakshme opened this issue Feb 2, 2024 · 3 comments
Closed
Tracked by #1540
Assignees

Comments

@mahalakshme
Copy link

mahalakshme commented Feb 2, 2024

https://avni.freshdesk.com/a/tickets/3462

Issue:

When auth-token within avni-media expires or doesn't exist, it displays the below page
Screenshot 2024-03-05 at 12 37 26 PM

Analysis:

  • From the avni-media codebase, looks like configuring the environment variableNEXT_PUBLIC_WEBAPP_BASE_URL will fix this.
  • Doesn't seem necessary to change the authentication mechanism, to be integrated with cognito to fix this. The developer can decide the same.

Acceptance criteria:

  • When https://app.avniproject.org/avni-media is hit in cognito or when auth token in local storage gets expired, user should be redirected to avni webapp login page
  • Then on typing the credentials, it should display the avni-media webpage without the user needing to navigate.
  • The above is what is happening for other URLs(say https://app.avniproject.org/#/appdesigner/subjectType) within Avni webapp
@mahalakshme mahalakshme converted this from a draft issue Feb 2, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Mar 1, 2024
@mahalakshme mahalakshme moved this from In Analysis Review to Ready in Avni Product Mar 5, 2024
@petmongrels petmongrels moved this from Ready to In Progress in Avni Product Mar 5, 2024
@petmongrels petmongrels self-assigned this Mar 5, 2024
petmongrels added a commit that referenced this issue Mar 6, 2024
… it back to avni web app home and hence to login screen
@petmongrels petmongrels moved this from In Progress to Code Review Ready in Avni Product Mar 6, 2024
@himeshr himeshr moved this from Code Review Ready to In Code Review in Avni Product Mar 7, 2024
@himeshr himeshr moved this from In Code Review to QA Ready in Avni Product Mar 7, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Mar 21, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to Test cases review in Avni Product Mar 21, 2024
@AchalaBelokar AchalaBelokar moved this from Test cases review to In QA in Avni Product Mar 21, 2024
@AchalaBelokar
Copy link

  • After half and hr I get this msg
  • I click on home button
    Whitelabel Error Page
    This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Mar 21 11:36:31 UTC 2024
There was an unexpected error (type=Unauthorized, status=401).
org.avni.server.domain.accessControl.AvniNoUserSessionException: No user, or not logged in at org.avni.server.framework.security.AuthService.changeUser(AuthService.java:106) at org.avni.server.framework.security.AuthService.authenticateByToken(AuthService.java:53) at org.avni.server.framework.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:70) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.keycloak.adapters.tomcat.AbstractAuthenticatedActionsValve.invoke(AbstractAuthenticatedActionsValve.java:67) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.invoke(AbstractKeycloakAuthenticatorValve.java:181) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:765) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1790) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:750)

@AchalaBelokar AchalaBelokar moved this from In QA to QA Failed in Avni Product Mar 21, 2024
@petmongrels petmongrels moved this from QA Failed to In Progress in Avni Product Mar 21, 2024
@petmongrels
Copy link
Contributor

petmongrels commented Mar 22, 2024

which environment was this tested on?

Ans: AchalaB@rwbnitiuat prerelease

@petmongrels
Copy link
Contributor

  1. login
  2. go to media viewer
  3. wait for 1.5 hours
  4. click home. it takes me to the login page

@petmongrels petmongrels moved this from In Progress to QA Ready in Avni Product Mar 26, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to Done in Avni Product Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants