-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Auth)Interceptor #666
Comments
@michael-gvdw
For any request, it will check if jwt token is valid or not. You can pass jwt secret using environment variable or hard code. |
@aakashkag
|
It's not finding your interceptor class on the classpath: There are two common ways to make your interceptor available:
|
@michael-gvdw I am attaching a code for you That includes "BasicSecurityInterceptor.java" |
How do I manually compile the Interceptor? Since hapi-fhir-jpa-started is running under docker environment |
I've never tried to use the hapi-extra-classes config, so I won't be of too much help.. but I assume you'd need to set up a Java project to compile your interceptor, then take the compiled artifact and inject it into the container. I don't know the precise steps though. |
@aakashkag I have downloaded the code and I tried to start the project by running the docker compose up --build command but it seems that is not able to find the new class. Have you run the provided code your self? if so what were the steps to run the project? |
when you say i have to re-build the project you mean build a new docker image? |
@michael-gvdw Yes, You need to rebuild docker image to reflect changes. |
@aakashkag maybe I am missing something. Once I downloaded the .zip file provided by you I ran the project by executing Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [ca.uhn.fhir.rest.server.RestfulServer]: Factory method 'restfulServer' threw exception with message: Interceptor class was not found on classpath: now I understand it is not able to find the interceptor but it is present in the code base and definded in the application.yaml file. So I am really confused why it does not start up with the custom interceptor. Any insight? |
There error shows: That is printed here: Interceptor class was not found on classpath What does your configuration look like for the property :
If I'm reading things correctly, it's looking for a class called "hapi-fhir-jpaserver-start". |
@XcrigX "hapi-fhir-jpaserver-start" is the name of the docker container. Interceptor class was not found on classpath I think classname is empty in the logs. the code i am using the the files provided by @aakashkag. |
What value do you have in your application.yml file for custom-interceptor-classes ? |
I managed to get it working. The issue was related to the application.yaml file when specifying the interceptors i had added a ',' at the end which caused the issue as the code tried to read one more interceptor which was just blank and that caused the error. |
Hello, I started using the fhir server a couple of days ago. At the moment I succesfully deployed the project with a postgres db using docker and the helm chart. I now face some uncertainty on how I can develope an Interceptor for the fhir server. Unfortunatelly the documentation on the official hapi fhir page is kinda unclear. Is anybody able to give a more comprehensive walkthrough of how it would be possible to develop an (auth)interceptor?
The text was updated successfully, but these errors were encountered: