jhipster ionic4 generated app can't authenticate to keycloak following article"How to Use Ionic 4 for JHipster 6 to Build a Mobile App" - ionic4

I was following the great article How to Use Ionic 4 for JHipster 6 to Build a Mobile App, and want to stay on Keycloak as a identity provider (for now :) )
I follow the article and pass successfully the generating, running and authenticate to app with built in credentials admin/admin.
At the second step I generated and run ionic app and typed:
cd mobile
ionic serve
and I got my mobile app running with login screen.
I typed again admin/admin and got folowing outhput in my backend app console:
2020-05-16 16:19:08.094 WARN 12590 --- [ XNIO-1 task-56] o.z.problem.spring.common.AdviceTraits : Forbidden: Could not verify the provided CSRF token because your session was not found.
2020-05-16 16:19:08.097 WARN 12590 --- [ XNIO-1 task-56] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.security.web.csrf.MissingCsrfTokenException: Could not verify the provided CSRF token because your session was not found.]
And of course i can't login to mobile app. I did not change anything related to Octa things (because it is Octa specific)
How can I enable and successfully log in to generated Ionic4 mobile app using Keycloak instead of Octa identity provider?

Related

Unable to issue redirect for OAuth 2.0 transaction - Auth0 login

I’ve just set up my login with Auth0 using Angular. I have created an application in Auth0 and connected it to a MongoDB database, I have tested this connection and it works fine.
When I click ‘Login’ in my angular application, I am presented with the Auth0 login interface. I entered login details to match credentials in my MongoDB database and was asked by Auth0 if my application could access my details, which I granted. After this, an error page appeared stating ‘Unable to issue redirect for OAuth 2.0 transaction’.
I’ve went back to look at my application settings and the allowed callback URLs, logged-out URLs and web origins have all been entered. I have no idea what could be causing this issue.
here is the context data:
“connection”: “MongoDB”,
“error”: {
“message”: “Unable to issue redirect for OAuth 2.0 transaction”,
“oauthError”: “server_error”,
“type”: “oauth-authorization”

Auth0 login locally

I have an application and an api, in terms of auth0, an static frontend and a expressjs backend, in production both are working. I setup Auth0 and users are able to login with Google accounts.
In production is working, but the problem I am facing is when I am working on my locally, when I run the application on my computer and I try to login I get the following error
Unhandled Runtime Error
Error: Request failed with status code 401
In the application setup I have
Allowed Callback URLs
https://www.myexample.com, http://localhost:3000, https://myexample.us.auth0.com/api/v2/
Allowed Logout URLs
https://www.myexample.com, http://localhost:3000
Allowed Web Origins
https://www.myexample.com, http://localhost:3000
and in the frontend
<Auth0Provider
domain="myexample.us.auth0.com"
clientId="XXXXXXXXXXX"
redirectUri={(process.browser) ? window && window.location.origin : 'http://localhost:3000'}
audience="https://myexample.us.auth0.com/api/v2/"
scope="read:current_user update:current_user_metadata"
>
If further information is needed, just let me know
I am not sure if I am missing some config or there is something I should change?

Keycloak error : [org.pac4j.oidc.credentials.authenticator.OidcAuthenticator]

I have integrated the CAS server with Keycloak version 12.0.4. When I go to the CAS login page it redirects me to the keycloak login successfully.
After entering the valid credentials in the keycloak page, it provides an error in the cas logs which is mentioned below:
2021-05-12 08:51:41,865 WARN
[org.pac4j.oidc.credentials.authenticator.OidcAuthenticator] -
<Preferred token endpoint Authentication method: null not available.
Defaulting to: private_key_jwt
Can someone tell me if I'm missing any configuration?
Seems the CAS was not able to take the properties from the cas.properties. I changed the class OidcAuthenticator in the cas package to choose the method "client_secret_basic" manually. After doing this change it's working fine.

Docker API logs JWT issue

I am using Docker to run containers for an app that uses Angular, Identity Server, and an API(using a Compose.yml file to run them all together).
The API is responsible for returning database info, based on the user logged in through Identity Server. Locally, the API returns the user info after login without any issues. However, when I use Docker to run the app, the user can login but not have their db info returned to the angular page. I checked the logs for the API container, and am receiving the following errors:
fail: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[3]
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
So it appears to me that there is an issue with the API receiving the token. I only see these error messages after I login through ID server. The ID server container logs do not display any errors before or after I login.
Can someone help me resolve this issue?

Facebook Login not working - nonexisting field on node type (AnonymousUser)

My app has Facebook Login. It has suddenly stop working. It is always login user as anonymous, so I am not getting any data. How to stop anonymous login for my App.
OAuthException, code: 100, message: (#100) Tried accessing nonexisting field (first_name) on node type (AnonymousUser), x-fb-trace-id: EQfRXtpQzk4 [HTTP 400]
SDK version 5.5.1 GA
This is a Facebook issue and there is an opened bug on their platform:
https://developers.facebook.com/bugs/173424853153369/