Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
cómo usar nest-keycloack-connect para iniciar sesión como usuario

estoy trabajando en un proyecto de nido y estoy tratando de manejar la autenticación usando keycloack y conecté mi aplicación al servicio keycloack

 KeycloakConnectModule.register({ authServerUrl: 'http://localhost:8080/auth', realm: 'demo', clientId: 'nest-app', secret: 'c3e273bc-3286-44a6-bc21-82195718f0fb', // Secret key of the client taken from keycloak server }),

y usé los decoradores y funcionaron bien

 @Controller() export class UserController { constructor(private readonly userService: UserService) {} @Get('/public') @Unprotected() getpublic(): string { return `${this.userService.getHello()} from public`; } @Get('/user') @Roles('user') getUser(): string { return `${this.userService.getHello()} from user`; } @Get('/admin') @Roles('admin') getAdmin(): string { return `${this.userService.getHello()} from admin`; } @Get('/all') @AllowAnyRole() getAll(): string { return `${this.userService.getHello()} from all`; } }

ahora me pregunto cómo iniciar sesión y registrar a un usuario desde el servidor nestjs. Miré y descubrí que puedo inyectar el

 constructor( @Inject(KEYCLOAK_INSTANCE) private keycloak: any, ) {}

ahora, ¿cómo se supone que debo usar eso porque no hay documentación sobre cómo usar el servicio y no hay autocompletar cuando lo hago?

 this.keycloack.login() // for example

podrías ayudarme por favor ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!