You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
Hi,
i don't know if this is the correct repository for my question?!
Success:
Queries/Mutations over httpUrl: 'https://hasura.xyz.de/v1/graphql' works -> AuthHeaders available (see getAuthContextProvider)
👍
Problem: Subscriptions over wsUrl: 'wss://hasura.xyz.de/v1/graphql' doesnt work: Error: "cannot start as connection_init failed with : Missing Authorization header in JWT authentication mode"
☹
So my scenario:
As backend i'm using Hasura with jwt-auth within a docker-container.
docker-compose.yml
version: '3.6'
services:
caddy:
image: caddy/caddy
ports:
- 443:443
volumes:
-
type: bind
source: ./Caddyfile
target: /etc/caddy/Caddyfile
- ./caddydata:/data
- ./caddy_certs:/root/.caddy
depends_on:
- hasura
hasura:
image: hasura/graphql-engine:v1.3.0
ports:
- "8080:8080"
depends_on:
- postgresd
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://hasurauser:xyz@postgresd:5432/hasuradb?sslmode=disable
## enable the console served by server
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
## enable debugging mode. It is recommended to disable this in production
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
## uncomment next line to set an admin secret
HASURA_GRAPHQL_ADMIN_SECRET: xyz
HASURA_GRAPHQL_JWT_SECRET: '{"type":"RS256","jwk_url": "https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com", "audience": "xyz", "issuer": "https://securetoken.google.com/xyz"}'
postgresd:
image: postgres:12
ports:
- "5432:5432"
restart: unless-stopped
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=xyz
- POSTGRES_DB=root
- PGDATA=/var/lib/postgresql/hasuradb
volumes:
- ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql
- ./hasuradb:/var/lib/postgresql/hasuradb
Caddyfile:
hasura.xyz.de {
reverse_proxy hasura:8080
}
docker_postgres_init.sql
CREATE USER hasurauser WITH PASSWORD 'xyz';
-- HASURA
CREATE DATABASE hasuradb
WITH
OWNER = hasurauser
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.utf8'
LC_CTYPE = 'en_US.utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE SCHEMA IF NOT EXISTS hdb_catalog;
CREATE SCHEMA IF NOT EXISTS hdb_views;
ALTER SCHEMA hdb_catalog OWNER TO hasurauser;
ALTER SCHEMA hdb_views OWNER TO hasurauser;
GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO hasurauser;
GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO hasurauser;
GRANT USAGE ON SCHEMA public TO hasurauser;
GRANT ALL ON ALL TABLES IN SCHEMA public TO hasurauser;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO hasurauser;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO hasurauser;
Firebase Functions to set Hasura-User-Claims and to add the Firebase-User into the Hasura-DB:
Hi @baststar, we have made the decision to move away from the Apollo client and we have decided to deprecate our Offix packages and release our Datastore. I will be closing this issue, but if you have any questions, please feel free to let us know.
Hi,
i don't know if this is the correct repository for my question?!
Success:
Queries/Mutations over httpUrl: 'https://hasura.xyz.de/v1/graphql' works -> AuthHeaders available (see getAuthContextProvider)
👍
Problem:
Subscriptions over wsUrl: 'wss://hasura.xyz.de/v1/graphql' doesnt work:
Error: "cannot start as connection_init failed with : Missing Authorization header in JWT authentication mode"
☹
So my scenario:
As backend i'm using Hasura with jwt-auth within a docker-container.
docker-compose.yml
Caddyfile:
docker_postgres_init.sql
Firebase Functions to set Hasura-User-Claims and to add the Firebase-User into the Hasura-DB:
As Frontend i'm using Angular with following packages:
apollo-client@2.6.10
offix-client-boost@0.15.5
For Authentication i'm using FirebaseAuth incl. Hasura-Claims
Inspired by https://github.com/aerogear/datasync-starter/tree/0.11.0
these are the relevant code-snippets:
graphql.module.ts
voyager.service.ts:
auth.service.ts
Payload of the token from firebaseAuth used by hasura:
The text was updated successfully, but these errors were encountered: