Comments (6)
Thank you for your swift reply!
Maybe I'm missing something, but isn't Oz.client.Connection
intended to help with the entire lifecycle, ticket reissue workflow, et c? Are you saying that should never happen in the browser, even for a client-side only application?
Other than the fact that app keys would not be secret in a browser app, I don't as of yet see why the entire workflow couldn't happen directly in the browser. Please help me understand.
from oz.
You don't need Oz.client
in the browser. You just need to use the hawk browser code directly. I have no idea about using it with browerify. I would never try that.
from oz.
In theory it could, but it was written for node, not the browser. If you are going to use it in the browser, you are on your own. I don't use it on the browser, I have my own browser logic code to handle it which I cannot share because it's too integrated into our logic. We just use hawk directly.
from oz.
Thanks for the update. I'm thinking Oz.client.Connection
would be very useful in any setting, including the browser.
Would you consider accepting a PR which solves this? Using the node http
/https
modules generally works fine with tools like Browserify, so I'm guessing the issue is somewhere in the way Wreck uses these modules, and could be remedied either by small changes to Wreck or using http
/https
directly in Oz.client.Connection
.
from oz.
Probably not. I am not a fan of using browserify.
from oz.
@richardolsson the hawk package.json lists "browser" pointing to dist/browser.js
. If you use require('oz/lib/client')
in browser code with webpack, then dist/browser.js
will be referenced as opposed to Hawk's lib/index.js
with its lib/client.js
.
The authenticate function signature in browser.js
accepts 4 arguments and synchronously returns a boolean. The client.js
authenticate accepts a 5th argument of a callback. Thus the callback is never being called:
const OzClient = require('oz/lib/client');
new OzClient.Connection({uri, credentials}).request("/protected", user_ticket, {}, (err, result, code, ticket) => {
// never reached
});
That might be the problem you're experiencing? Anyway, if I can't iron (no pun intended ;) ) it out I will follow hueniverse's advice and build my own wrapper around hawk. Though as you also said it would be nice to avoid copy and pasting the work hueniverse has put into the client.Connection helper for client-side applications.
from oz.
Related Issues (20)
- Validate app credentials before issuing access delegation tickets HOT 1
- Scope comparison utility
- Update dependencies
- Update deps
- Update hawk
- Q: Why 'use' passwords? HOT 2
- Update deps
- Redirect endpoint in Oz: Does Oz have the same vulnerability as OAuth 2.0? HOT 3
- How does delegation work? HOT 1
- Delegated Authentication HOT 1
- Is this project dead? HOT 2
- Async API
- Replace default argument value
- Update deps
- Example app? HOT 1
- Confirming understanding of Oz workflow HOT 2
- PHP Port
- Proposals for 2 More Oz Workflows
- Update deps
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 oz.