Coder Social home page Coder Social logo

Demo site? about angular-digest-auth HOT 5 CLOSED

tafax avatar tafax commented on July 27, 2024
Demo site?

from angular-digest-auth.

Comments (5)

tafax avatar tafax commented on July 27, 2024

@DibbsZA sorry, but I don't have a site yet. Anyway, what kind of problem do you have? Write some errors or other info so that I can better understand.

from angular-digest-auth.

DibbsZA avatar DibbsZA commented on July 27, 2024

Hi,

Thanks for your reply.

I was hoping to see a tested example of a full implementation in code so I
could compare with my interpretation of the docs.
Specifically I am struggling with:

  • Login/Logout Configuration -
    "Create the services to sign in and sign out in order to simulate the
    login and the logout in your app.
    "

    Are these Angular Services to which you refer?
    Do the URLs point to templates in the app which bind to Controllers and
    thereby these defined services?
    If so, do these services make any actual (simulate?) calls to the
    backend REST endpoint?
    If so, should I use $http or $resource in their function to make calls
    to the backend?
    Do I make the calls to the standard data request endpoint or should I
    implement a specific Login/Logout URI?

  • Header
    "You should define a custom header in the server side in order to avoid
    the browser form and use your custom login form.
    "
    What if the backend-service is not mine to customise?

  • Usage
    "dgAuthService.start();"
    After calling this function, how does the sign-in process know what URI
    to call to attempt the login?
    Where do I define the redirect to the login form or should I open the
    app already on this form?

I would really appreciate any feedback on these points if you wouldn't mind.

Thanks
Gary

On Wed, Apr 23, 2014 at 12:36 AM, tafax [email protected] wrote:

@DibbsZA https://github.com/DibbsZA sorry, but I don't have a site yet.
Anyway, what kind of problem do you have? Write some errors or other info
so that I can better understand.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-41104470
.

from angular-digest-auth.

tafax avatar tafax commented on July 27, 2024

@DibbsZA I'll try to explain better than I did(I think some of your questions has already a response in the README).

The point is: to use the service(dgAuthService) you have to be able to change the header name with a custom name. This is needed because the default header name, in the response, for the Digest Authentication(DA) is handled by the browser and the browser itself displays a form before the JS is able to intercept the request. So, if you don't have this ability, probably the library is not so useful for you.

Anyway, I don't know a way to solve this problem in a browser, but if you know something that can work, you can do a pull request. I like the contributors 👍

Anyway, when I speak about service I mean web service. You can use REST or some other technologies, but the response should be a valid JSON. The library only works with JSON. If you don't have this web services, you should implement them. If you take a look in the "Login and logout" section in the README you can see how to configure the requests. The object, specified both for login and for logout request, is the same object that you would specify if you called the $http service directly. You can customize the requests as you want.
When you call start in the dgAuthService the service calls the login to know the header information(without a valid header specified by the client, the server should respond with the information to create a valid one in the client side). If it is needed, it asks for the credentials and then it uses all information to create a valid header, afterwards it calls again the login URL. You don't have to handle this workflow, the library does this for you.
By looking in the "Callbacks" section, you should see how to handle the behaviors during the workflow that I mentioned above.

During the login:

  • successful function: you can redirect the user to your home page, for example. The function is called when the login web service responds with the code 200. This should be so when the credentials of the user are correct.
  • required function: it is called when the credentials are needed, so you can display your custom form to do the login.
  • error and limit functions: they are called when an error occurs and when the request limit is exceeded respectively.

With your custom functions you can handle the behaviors to fit your purpose.

I hope this description could be useful for you. Anyway, I think the point is only the custom header name. You should have the ability to specify it.

Let me know.

from angular-digest-auth.

tafax avatar tafax commented on July 27, 2024

Closed for inactivity

from angular-digest-auth.

nzamosenchuk avatar nzamosenchuk commented on July 27, 2024

Hi guys. I'll post question here. I'm really confused.

I have a JBoss server with it's standard Digest Authenticator that is slightly updated to use custom header. No other changes.

I've configured angular-digest-auth. And trying to perform sigin previously setting the user name and password.

But what I see in network monitor, is that nonce sent by server and responded by library doesn't match. But they should, aren't they? So the server always responds with 401 without proceeding with authentication. (but it's standard jboss authenticator with only the custom header).

Do You have any ideas? I really, really confused. And hope You can give some tips on this topic to resolve this strange thing.

from angular-digest-auth.

Related Issues (20)

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.