"Intercepted a disabled resource" when attempting to Authenticate

Hello. I am new to nakama. I have been trying to get a the server authentication working for the past 3 days now. I have been stuck at the same error. I have tried running the server locally and as well as on the internet. Still getting the same error.

On the client side (flutter) it says:

gRPC Error (code: 5, codeName: NOT_FOUND, message: Requested resource was not found., details: , rawResponse: null, trailers: {})

Server-side logs shows the following:

{“level”:“info”,“ts”:“2025-01-25T01:58:37.511Z”,“caller”:“main.go:229”,“msg”:“Startup done”}
{“level”:“warn”,“ts”:“2025-01-25T01:58:45.722Z”,“caller”:“server/api_authenticate.go:210”,“msg”:“Intercepted a disabled resource.”,“resource”:“/nakama.api.Nakama/AuthenticateDevice”}

Here is the client code:

static final NakamaService _instance = NakamaService._internal();
  factory NakamaService() => _instance;
  NakamaService._internal();

  late final NakamaBaseClient client;
  Session? _session;

  Future<void> initialize() async {
    client = getNakamaClient(
      host: '192.168.8.106', // Your server IP
      ssl: false,
      serverKey: 'defaultkey', // Must match the server_key in config.yml
      grpcPort: 7349,
      httpPort: 7350,
    );
  }

Future<Session> authenticateDevice(String deviceId) async {
    try {
      final session = await client.authenticateDevice(deviceId: deviceId);
      _session = session;
      log('Authentication successful. Session Token: ${session.token}');
      return session;
    } catch (e) {
      rethrow;
    }
  }

Here is the server config

name: nakama
data_dir: "/nakama/data"
logger:
  level: "debug"
  stdout: true
  file: ""
runtime:
  path: "/nakama/data/modules"
console:
  port: 7351
  username: "admin"
  password: "xxxxxxxxx"
authentication:
  device:
    # Enable device authentication
    enabled: true
  email:
    enabled: true
  token:
    expire_seconds: 3600 # 1 hour token expiry

api:
  server_key: "defaultkey" # Change this in production!

session:
  token_expiry_sec: 7200 # 2 hours session duration
  refresh_token_expiry_sec: 86400 # 24 hours refresh token duration

socket:
  server_key: "defaultkey"

I am currently on docker. Appreciate your time :slight_smile:

Hello @TheRealFaruhaan,

Have you registered any before hook on AuthenticateDevice?