-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How to setup OAuth2 #915
Comments
Is the OAuth2 implemented by yourself? If it is self-implemented, you need to return the JSON data in the API response, and the JSON should include a unique identifier, like If you have configured another OAuth2 service, please tell us which one you have configured. Google? Additionally, providing your OAuth configuration can help us pinpoint the issue.
You can build docker image with your own plugins. FYI: https://answer.apache.org/docs/plugins#build-docker-image-with-plugin-from-answer-base-image
Let me make it clear. OAuth2 servier response JSON will be like. {
"user_id": "xxx",
"eamil": "[email protected]"
} The |
Hello. SAP BTP(Cloud Platform) provides IAS(Identity Authentication Service), and I used it for OAuth2 service. And OAuth2 response JSON is as followings. Please note what value I should use for User ID JSON Path.
For debugging the second source, I tried the following.
|
Maybe you haven't modified the module declare to |
Please check go.mod file modified by myself.
|
@micol92 OK, maybe I found the problem. You should import "github.com/micol92/jw-incubator-answer-plugins/connector-basic/i18n" not "github.com/apache/incubator-answer-plugins/connector-basic/i18n" |
BTW, using |
Thank you for your prompt update. I've modified "basic.go" file you mentioned, but it failed. Please review the error log below. By any chance, could you share a docker image that reflects the source code I'm curious about?
|
@micol92 I make a PR to fix your compile error. micol92/jw-incubator-answer-plugins#1 After merge it, add new tag and build with new tag version. $ git pull
$ git tag connector-basic/v1.2.7
$ git push origin connector-basic/v1.2.7 FROM apache/answer as answer-builder
FROM golang:1.19-alpine AS golang-builder
COPY --from=answer-builder /usr/bin/answer /usr/bin/answer
RUN apk --no-cache add \
build-base git bash nodejs npm go && \
npm install -g [email protected]
RUN answer build \
--with github.com/micol92/jw-incubator-answer-plugins/[email protected] \
--output /usr/bin/new_answer
FROM alpine
LABEL maintainer="[email protected]"
ARG TIMEZONE
ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}
RUN apk update \
&& apk --no-cache add \
bash \
ca-certificates \
curl \
dumb-init \
gettext \
openssh \
sqlite \
gnupg \
tzdata \
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone
COPY --from=golang-builder /usr/bin/new_answer /usr/bin/answer
COPY --from=answer-builder /data /data
COPY --from=answer-builder /entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
VOLUME /data
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"] |
I'm very appreciate with your help. |
As an additional question, if I build the AWS S3 plugin, will I be able to add attachments to my questions? And if I add the Elastic search plugin, will I be able to perform full-text search on attachments? |
@micol92 You need redeploy again. Becasue we do not support data migration currently. FYI: https://answer.apache.org/docs/faq#what-are-the-currently-supported-database-types-is-migration-supported |
Thank you. |
Describe the bug
A clear and concise description of what the bug is.
I'm trying to set up Answer in my SAP BTP Kyma runtime(aka managed K8s), confirmed that basic functions(Q&A) works well, and would like to specify OAuth2 configuation to connect my Identity Provider.
It looks that configuration tasks are almost done, but it fails after logging and erros occurrs as below.
---error message in my K8s Pod.
2024-04-21 13:50:00.316 ERROR connector-basic/basic.go:155 fail to get user id from json path: email
--error screen in my web page.

see the attached file.
To Reproduce
It's possible to reproduce, but if you really need to, we'll pass along the information you need to configure it.
Expected behavior
Can I modify the original source and leave a log for debugging?
Here is the source for the step before the error occurs, and I would like to see the data and userinfo.
----connector-basic/basic.go
data, _ := io.ReadAll(response.Body)
A clear and concise description of what you expected to happen.
Screenshots
see the attached file for error screen.
Platform
The text was updated successfully, but these errors were encountered: