Skip to content
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

Need bearer token authentication for API calls #161

Closed
yasharpm opened this issue May 16, 2023 · 13 comments · Fixed by #176
Closed

Need bearer token authentication for API calls #161

yasharpm opened this issue May 16, 2023 · 13 comments · Fixed by #176
Assignees

Comments

@yasharpm
Copy link
Collaborator

No description provided.

@navid-shokri
Copy link
Collaborator

navid-shokri commented May 22, 2023

https://doc.owncloud.com/server/next/admin_manual/configuration/server/security/oauth2.html 🎯
there is an app that can handle the Oauth2 protocol

my Oauth setup can be found here: ℹ️
https://github.com/pondersource/dev-stock/tree/oauth

@navid-shokri
Copy link
Collaborator

navid-shokri commented May 22, 2023

owncloud/oauth2#295 🎯

it seems we can generate an access token using this method without interacting with GUI

@navid-shokri
Copy link
Collaborator

https://doc.owncloud.com/server/next/developer_manual/core/apis/externalapi.html 🎯
this is another way that is suggested in Owncloud

@navid-shokri
Copy link
Collaborator

@navid-shokri
Copy link
Collaborator

navid-shokri commented May 23, 2023

I hope it helps ℹ️
https://github.com/owncloud/oauth2/blob/master/lib/AuthModule.php

👎 it did not 🔴

@shokri-navid
Copy link
Collaborator

shokri-navid commented May 24, 2023

there is a discussion thread on this topic:
owncloud/oauth2#354

@navid-shokri
Copy link
Collaborator

navid-shokri commented May 24, 2023

It seems there are four Options: 🏁

1- implement the client_credentials grant type best on the below RFC:
https://datatracker.ietf.org/doc/html/rfc6749
2- use the basic authorization header.
3- create an unofficial authorization/authentication approach just for our application. base on the OAuth2 app infrastructure and our needs.
💥 4- It seems that issuing the token by ownCloud could be a bad approach. because all the Owncloud servers should inform the rd-API about the user/client. but as I know SRAM is a token provider and it can issue access tokens for all users to access their Owncloud server. So, I guess it is more reasonable that we assign the token generation to the SRAM and just handle the given access token in our app (scimController)💥

@michielbdejong

@navid-shokri
Copy link
Collaborator

for the first option, there is a more detailed workflow clarification. ℹ️
https://datatracker.ietf.org/doc/html/rfc6749#section-4.4

@T0mWz
Copy link

T0mWz commented May 30, 2023

We use this in another app, to check of a user is authenticated
https://doc.owncloud.com/server/next/developer_manual/core/apis/externalapi.html

@T0mWz
Copy link

T0mWz commented May 30, 2023

Simple authentication token is also an option, which should be configured in config before.

@navid-shokri
Copy link
Collaborator

navid-shokri commented Jun 6, 2023


I create a Middleware to check the existence and validity of the "Authorization" header in Scim Requests.
but it seems that the Authorization header is not accessible in the Request object. so, I just put the authorization header inside 'x-auth' header.
is it good to approve or should I find a way to work just with the authorization header?

@michielbdejong

@michielbdejong
Copy link
Contributor

let's go with the x-auth approach!

@shokri-navid shokri-navid linked a pull request Jun 6, 2023 that will close this issue
@navid-shokri
Copy link
Collaborator

🎉
so, it is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants