Giter VIP home page Giter VIP logo

idp's People

Contributors

boyvinall avatar janekolszak avatar mfzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

idp's Issues

Using a better name for Respond in Provider interface

Wouldn't it be better for Provider to have something similar to WriteError instead of Respond. I feel that Respond means to send a normal response of some sort.

I wanted to quickly highlight this before API matures, while we still have a chance to break the API.

Appreciate what you've done here. It's a huge undertaking. ๐Ÿ‘

Refactoring idp

A major refactoring is getting close.

In order to avoid any build breaks be sure to use release 0.1.0 of idp.

Things that will change:

  • No more providers, helpers, userdb. I learned it's impossible to cover all use cases in this project.
  • No more vendor directory, only one .glide file
  • I will try not to break the examples, but I won't guarantee they all gonna make it.
  • core package will be moved to the root of the directory

add the "forms" provider

Placeholder issue for pulling together some discussion/thoughts on this. Couple of thoughts on this at the moment:

  • I think the providers should be able to add their own hooks on the httprouter. The forms provider will need sign-up, verify-email-address and some other endpoints that are not needed for other providers
  • I'm not 100% comfortable with the HandleChallengeGET() being registered for both GET & POST on the root endpoint. This relates a little to the discussion in #3 over the Respond() method - I was thinking that the forms provider would only ever return a form for GET, but I don't want to interfere and take this some direction you don't want.

I'm happy to put some work into this.

Challenges

Hello,

First of all, thanks for providing this library!

Would you be able to point me in the right direction? I do not ask you to solve my issue but just let me know what I should look into...

I am using the form with rethinkdb and get it working within my environment. But I never get the consent request.

  • I register my user, ok
  • got verification email ok
    But then when i moved back to /, I do not get redirected to /consent.

From the code I can see that this is because there is no challenge in the request.
challenge, err := h.IDP.NewChallenge(r, user)
if err != nil { <=== err not nil.... Bad request
fmt.Println(err.Error())
h.Provider.WriteError(w, r, err)
return
}

My question is how am I supposed to get it? I am missing something probably silly as I am new to IDP.
Can you give me a hint or a few words about the expected worklflow?

Thanks a lot,
Steve.

The requested scope is invalid, unknown, or malformed

I tried to sample from the readme:

import (
    "github.com/janekolszak/idp"
    "github.com/antonlindstrom/pgstore"
    "time"
)

func main() {
    challengeCookieStore, err = pgstore.NewPGStore("postgres://user:pass@address/dbname", []byte("secret"))
    // Return on error

    // Create the IDP
    IDP := idp.NewIDP(&idp.IDPConfig{
        ClusterURL:            /* Hydra's address */,
        ClientID:              /* IDP's client ID */,
        ClientSecret:          /* IDP's client secret */,
        KeyCacheExpiration:    time.Duration(/* Key expiration time */) * time.Second,
        ClientCacheExpiration: time.Duration(/* Client info expiration */) * time.Second,
        CacheCleanupInterval:  time.Duration(/* Cache cleanup interval. Eg. 30 */) * time.Second,
        ChallengeExpiration:   time.Duration(/* Challenge cookie expiration. Eg. 10 */) * time.Minutes,
        ChallengeStore:        challengeCookieStore,
    })

    // Connects with Hydra and fills caches
    err = IDP.Connect(true /*TLS verification*/)
    // Return on error
}

and I got:

panic: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_scope","error_description":"The requested scope is invalid, unknown, or malformed","statusCode":400}

I created the client and secret with hydra clients create.

I started hydra with docker run -d --name my-hydra -p 4444:4444 -e CONSENT_URL=http://<my_ip>:3000 oryd/hydra.

using go-cache prevents HA deployment

It would be good if a high-availability configuration was possible. Using go-cache prevents this as it's all in single-process on one machine. However, I do like the simplicity of go-cache for getting started. How about abstracting the cache implementation to an interface which is pushed down from main()? Can provide go-cache as a simple implementation, but it opens the possibility to provide alternative implementations (memcache/groupcache etc)

Happy to do this for you..

PS - I know this is still early-stages, and really appreciate what you're doing with this. ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.