FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. zaalbarxx
    Z
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 7
    • Best 0
    • Controversial 0
    • Groups 0

    zaalbarxx

    @zaalbarxx

    0
    Reputation
    1
    Profile views
    7
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Age 34

    zaalbarxx Unfollow Follow

    Latest posts made by zaalbarxx

    • E-mail template macros

      Hello!
      Is it possible to use macros in e-mail templates ? I'd like to create some shared HTML template for e-mails which then could be reused in e-mails, similar to how theme templates work, I've tried putting some new macro to theme's helpers.ftl, but email parser seem to not load this file during e-mail generation. Is it possible to somehow abstract the logic for e-mails or I'd have to duplicate the HTML for each email/use some custom scripting etc ?
      Cheers

      posted in Q&A
      Z
      zaalbarxx
    • RE: Login stopped working - `missing_code` error using SDK

      @Alex-Patterson No, I've been using 1.50.1 version of FusionAuth (read from the admin panel) all the time. The only thing that changed was provider version. Like I said I can just switch between versions and it will start/stop working immediately, so I assume that version 0.1.106 may add some implicit parameter which changes something.
      I just checked it after using docker-compose down -v and docker-compose up (fresh installation) and after running the Terraform the error still persists. What's interesting is that I've checked the diff between 0.1.105 and 0.1.106 on FusionAuth Terraform repo https://github.com/FusionAuth/terraform-provider-fusionauth/compare/v0.1.105...v0.1.106 and it does not seem that anything that could be related was changed there, maybe it is related to Go client or something ?

      EDIT:
      Ok, I found the culprit, looks like between 0.1.105 and 0.1.106 there is some change that automatically sets this to either false (106) or true (105):

      Application -> Scopes -> Provided Scopes
      Here there are some default scopes, address, email, phone and profile.

      The problem here is that it looks like the Terraform provider currently does not allow to set these variables in schema, so basically we are blocked between older version with unsupported configurations like theme's oauth_consent and newer version which handles these scopes inproperly (we can change it manually, but obviously each deployment will cause the values to reset back to false).

      https://github.com/FusionAuth/terraform-provider-fusionauth/issues/277

      I hope this will get resolved quickly since right now it is quite a blocker.

      posted in Q&A
      Z
      zaalbarxx
    • RE: E-mail field not exists in access token

      @Alex-Patterson Then I believe you should update your example repo, because the code there mistakenly makes reader think that the email will be there. Anyway, thanks for clarification, cheers 🙂

      posted in Q&A
      Z
      zaalbarxx
    • Login stopped working - `missing_code` error using SDK

      Hi, another day, another problem 🙂
      Suddenly the login stopped working for some reason (no dependencies changed and I believe no settings for FusionAuth too)

      Using Vue SDK this login redirect URL is generated:
      http://localhost:9011/app/login?client_id=e9d1e58d-d076-439a-b92d-a0e5f76cceef&redirect_uri=http%3A%2F%2Flocalhost%3A3010%2Fauth%2Fcallback&scope=offline_access+openid+email&state=redirect_to%253Dtrue

      The browser redirects to this address then redirect back to http://localhost:3010/auth/callback with this query string:
      { error: 'invalid_request', error_description: 'The request is missing a required parameter: code', error_reason: 'missing_code', state: 'redirect_to%3D%2F' }

      Everything seemed to work fine up until now and I cannot find any related issue.
      Application do have PKCE set as not required as on the screenshot:
      ae102210-5b12-4c52-9b33-15f517c3bafc-image.png

      This is an event from the event log:

      Unable to complete app login. The auth code exchange has failed.
      Application Id: e9d1e58d-d076-439a-b92d-a0e5f76cceef
      Status code [400]
      
      Error response is 
      {
        "error" : "invalid_request",
        "error_description" : "The request is missing a required parameter: code",
        "error_reason" : "missing_code"
      }
      

      Changing the enabled grants from Authorization code to Password changes the error query to:

      { error: 'unauthorized_client',
        error_description:
         'The [authorization_code] Authorization Code grant has been disabled for this client.',
        error_reason: 'grant_type_disabled',
        state: 'redirect_to%3D%2F' }
      

      but I guess since Authorization code was working previously and password grant is "legacy", I should use former.

      Edit: From what I see the problem starts to appear right after I update Terraform provider from 0.1.105 to 0.1.106. When I change to 0.1.105 to it starts to work properly.

      posted in Q&A sdk login
      Z
      zaalbarxx
    • E-mail field not exists in access token

      According to the docs here:
      https://fusionauth.io/docs/quickstarts/quickstart-php-laravel-api#provisioning-new-users
      the access token received from the FusionAuth should contain email field. But it does not. After logging in the app.at token looks like this:
      96b5500b-7749-4773-8c8d-1382e6b5e12f-image.png

      Is this the correct behavior ? I mean, the e-mail is there in the app.idt along with other data:
      1ecc59bb-91dd-43cf-8a4a-0b27df590ebf-image.png

      Wouldn't it be better to change app_at to app_idt here to actually parse and verify ID Token instead of access token ?
      c8f552b6-3cf0-45ea-8d75-1230182dd642-image.png

      posted in Q&A php token email laravel
      Z
      zaalbarxx
    • RE: API Keys page 500

      @dan Yes, it works as temporary solution. Thanks!

      posted in Comments & Feedback
      Z
      zaalbarxx
    • API Keys page 500

      Hello, for some reason the API keys page throws 500 error with this stack trace

      2024-05-07 12:25:32.747 PM ERROR io.fusionauth.app.primeframework.error.ExceptionExceptionHandler - An unhandled exception was thrown
      org.apache.ibatis.exceptions.PersistenceException: 
      ### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: column "key" does not exist
        Position: 804
      ### The error may exist in io/fusionauth/api/domain/APIKeyMapper.xml
      ### The error may involve defaultParameterMap
      ### The error occurred while setting parameters
      ### SQL: SELECT k.id                         AS k_id,            k.insert_instant             AS k_insert_instant,            k.ip_access_control_lists_id AS k_ip_access_control_lists_id,            k.last_update_instant        AS k_last_update_instant,            k.key_manager                AS k_key_manager,            k.key_value                  AS k_key_value,            k.tenants_id                 AS k_tenants_id,            k.permissions                AS k_permissions,            k.meta_data                  AS k_meta_data       FROM authentication_keys AS k          WHERE  (         k.meta_data IS NULL         OR NOT (k.meta_data::JSONB ?? 'attributes'            AND k.meta_data::JSONB -> 'attributes' ??| array['internalCacheReloader', 'internalLogDownloader'])         )              ORDER BY key desc                   LIMIT ?                   OFFSET ?
      ### Cause: org.postgresql.util.PSQLException: ERROR: column "key" does not exist
        Position: 804
      	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
      	at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      	at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:355)
      	at jdk.proxy2/jdk.proxy2.$Proxy54.selectList(Unknown Source)
      	at org.apache.ibatis.session.SqlSessionManager.selectList(SqlSessionManager.java:204)
      	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
      	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
      	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141)
      	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
      	at jdk.proxy2/jdk.proxy2.$Proxy59.retrieveByCriteria(Unknown Source)
      	at io.fusionauth.api.service.system.DefaultAPIKeyReaderService.search(DefaultAPIKeyReaderService.java:66)
      	at io.fusionauth.app.action.admin.apiKey.IndexAction.search(IndexAction.java:51)
      	at io.fusionauth.app.action.admin.BaseSearchAction.execute(BaseSearchAction.java:77)
      	at jdk.internal.reflect.GeneratedMethodAccessor129.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      	at org.primeframework.mvc.util.ReflectionUtils.invoke(ReflectionUtils.java:443)
      	at org.primeframework.mvc.action.DefaultActionInvocationWorkflow.execute(DefaultActionInvocationWorkflow.java:77)
      	at org.primeframework.mvc.action.DefaultActionInvocationWorkflow.perform(DefaultActionInvocationWorkflow.java:60)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.message.DefaultMessageWorkflow.perform(DefaultMessageWorkflow.java:50)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.validation.DefaultValidationWorkflow.perform(DefaultValidationWorkflow.java:45)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.security.DefaultSecurityWorkflow.perform(DefaultSecurityWorkflow.java:79)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.parameter.DefaultPostParameterWorkflow.perform(DefaultPostParameterWorkflow.java:49)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.content.DefaultContentWorkflow.perform(DefaultContentWorkflow.java:74)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.parameter.DefaultParameterWorkflow.perform(DefaultParameterWorkflow.java:58)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.parameter.DefaultURIParameterWorkflow.perform(DefaultURIParameterWorkflow.java:92)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.scope.DefaultScopeRetrievalWorkflow.perform(DefaultScopeRetrievalWorkflow.java:50)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.action.DefaultActionMappingWorkflow.perform(DefaultActionMappingWorkflow.java:119)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.security.DefaultSavedRequestWorkflow.perform(DefaultSavedRequestWorkflow.java:65)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.cors.CORSRequestWorkflow.perform(CORSRequestWorkflow.java:65)
      	at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
      	at org.primeframework.mvc.workflow.DefaultMVCWorkflow.perform(DefaultMVCWorkflow.java:108)
      	at org.primeframework.mvc.PrimeMVCRequestHandler.handle(PrimeMVCRequestHandler.java:73)
      	at io.fusionauth.http.server.HTTPWorker.run(HTTPWorker.java:50)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: org.postgresql.util.PSQLException: ERROR: column "key" does not exist
        Position: 804
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371)
      	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:502)
      	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:419)
      	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)
      	at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:180)
      	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
      	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
      	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65)
      	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80)
      	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
      	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336)
      	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
      	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
      	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:90)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154)
      	... 53 common frames omitted
      

      I don't think we've change anything and we are using cloud instance. Any idea how to fix this ?

      posted in Comments & Feedback
      Z
      zaalbarxx