Comments (4)
👍 for authorize and authorizeAsync
from scala-oauth2-provider.
Before we decided to change all interfaces of DataHandler
to async by #18.
OAuthProvider's standard interface also change to async would be prefered.
This is just my idea.
We define OAuth2ProviderAwait
trait, we can wrap await
method with issueAccessToken
and authorize
methods on OAuthAsyncProvider
.
trait OAuth2ProviderAwait {
def await(f: Future[Result], timeout: Duration = 60.seconds): Result = Await.result(f, timeout)
}
object OAuth2Controller extends OAuth2AsyncProvider with OAuth2ProviderAwait {
def index = Action.async { implicit request =>
authorize(new MyDataHandler()) { authInfo =>
Future.successful(Ok)
}
}
def action = Action { implicit request =>
await(authorize(new MyDataHandler()) { authInfo =>
Future.successful(Ok)
})
}
}
Then, we don't need to create methods for sync and async into OAuth2Provider
.
Finally, OAuth2Provider
can also be integrated with OAuth2AsyncProvider
.
from scala-oauth2-provider.
👍
from scala-oauth2-provider.
I'm planing to release version 1.0.0 which means to not change destructive interface.
Before the release, I'm going to try the change.
from scala-oauth2-provider.
Related Issues (20)
- Scala 2.12 support HOT 3
- Consider using scalafmt HOT 2
- value clientCredential is not a member HOT 2
- AccessToken never expires HOT 2
- Enhancing AuthInfo HOT 7
- Can no longer accept query string parameters HOT 1
- The same expiresIn is returned if the token is requested twice. HOT 4
- Not able to find out the Main method, web server start code, endpoints(routes) code HOT 1
- publish for Scala 3 HOT 1
- Disable all grant by default
- Authenticate Users Using Subdomains HOT 1
- [Question] Spray.io example ? HOT 1
- [Question] Java implementation HOT 1
- JSON error for OAuth2Provider.authorize HOT 1
- Should it be possible to have a ClientGrant without an AuthUser.info? HOT 3
- Unauthorized handling HOT 4
- Customize access to an authorized resource using Action Composition HOT 4
- Multiple DB requests HOT 1
- According to the RFC, client credential flow do not have to be linked to a user HOT 1
- akka-http-oauth2-provider miss a way to extend the AccessToken response HOT 1
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 scala-oauth2-provider.