Comments (5)
It is possible, This is basically what i had to do to make it work with Extension, You can take a look at my implementation in the extension in the actions and what calls that, or if you want to go and read the documentation of next-auth (or see what is called when you log in into Linkwarden) https://next-auth.js.org/getting-started/rest-api
https://github.com/linkwarden/browser-extension/blob/main/src/%40/lib/auth/auth.ts
from linkwarden.
For logging into your self-hosted Bitwarden through the REST API, if the documentation lacks specific details on authentication for existing users, consider looking into generic authentication endpoints often provided for session creation or token generation. Typically, APIs offer endpoints for "login" or "authenticate" actions, requiring credentials in the request body.
If further clarification or testing is needed, Apidog could be a valuable tool. It allows you to explore and test API endpoints interactively, helping you to understand the authentication flow, even when documentation is incomplete or unclear. Utilizing Apidog can assist in determining the correct approach for logging in via the API.
from linkwarden.
@crkos i have checked your implementation and I have done the same:
- Get the csrf token with the
/auth/csrf
endpoint - Call to
/auth/callback/credentials
with the following form data, being callbackUrl"$baseUrl/login"
:
{
"username": Uri.encodeFull(username),
"password": Uri.encodeFull(password),
"redirect": false,
"csrfToken": Uri.encodeFull(csrfToken),
"callbackUrl": Uri.encodeFull(callbackUrl),
"json": true,
}
But I receive a 302 from the second endpoint. Do you know why this can happen?
from linkwarden.
Mmm not really, did you send it as 'Content-Type': 'application/x-www-form-urlencoded'?, I think this is the only way to make it work, other thing is that you may already have a cookie set
from linkwarden.
Yes, I am adding the content type. I'm working on a Flutter mobile application but I cannot make to work the follow redirect after the response of that second endpoint. It appears that flutter's http package doesn't support follow redirect for post requests, so I'm getting a 302.
from linkwarden.
Related Issues (20)
- duplicate tags
- Custom Generated Title on Preserved Format Widow
- Add functionality HOT 1
- Open a pre-populated 'Add Link' page from a URL.
- Can't Login after user Creation HOT 6
- What is this variable "NEXTAUTH_SECRET" needed for? HOT 2
- Multiples Enhancements propositions ? HOT 6
- Add a button to copy link to clipboard button
- Are snapshots overwritten? HOT 1
- How to add EMAIL_SERVER string in manual installation HOT 2
- Reverse proxy into a basePath HOT 2
- Link directly to bookmark in app
- database could not receive data from client: Connection reset by peer
- How to enable SSL inside the docker container HOT 1
- Subdirectory hosting HOT 1
- Extremely high ressource usage - Is that normal? HOT 3
- Requesting demo instance (or even screenshots) for Linkwarden HOT 1
- Integrate Monolith to save pages as html
- Feature Request: MariaDB possibility instead of postgres
- Docker failiure with App/Database
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linkwarden.