Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    @danderson00 maybe i'm thinking about it incorrectly, but i was concerned that it might not be a good idea to be calling getIdentity on every request?
    i have a middleware that is adapted from / similar to this one: https://github.com/adrianhall/30-days-of-zumo-v2/blob/day-22/blog-code/backend/authMiddleware.js
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    since i really want to run this logic only once per user, after the user's first authentication, i was looking for a way to do that explicitly. but maybe it's fine to just wait and run the logic in the "user exists but is not yet cached" scenario in that middleware?
    btw, the larger goal here is arbitrary linked identities, so maybe there's a different approach altogether to accomplish that?
    ToGoNow
    @togonow
    when dealing with tables req.azureMobile.tables('tablenamehere').read()..... is there a way to only select certain columns instead of selecting the whole record. I remember the deprecated azure mobile services had this feature without using straight sql statements. Is there equivalent readable documentation for the azure-mobile-apps related to sql / table operations other than https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-html-how-to-use-client-library
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    @togonow don't know the answer to your question but i did find api docs linked here: https://github.com/Azure/azure-mobile-apps-node#documentation--resources
    ToGoNow
    @togonow
    found it. I simulated the same pattern based on the deprecated azure-mobile-services from https://msdn.microsoft.com/library/azure/jj613353 req.azureMobile.tables('tablenamehere').select('id', 'firstname', 'lastname').read() and i only got the needed columns. @ephemorality Thanks for the reference, but unfortunately the documentation is not very thorough into the details of azure queries / options etc... @danderson00 Can we have an updated reference same as azure mobile services specially i noticed that the azure-mobile-serivces documents has been removed from the support site. I was able to find the link of the deprecated function above hidden deep in ChrisRisner.com page: http://chrisrisner.com/Common-Scenarios-with-Windows-Azure-Mobile-Services which has been very helpful to many of us
    Swapnil Tripathi
    @tripathi-swapnil
    i need to change JWT time from where i can change expiresInMinutes?
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    @Anshdesire you want change that for all tokens?
    Swapnil Tripathi
    @tripathi-swapnil
    yes for all tokens
    globally
    and wanna add db query logging as well
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    if your tokens are issued by AAD B2C, everything I've read seems to suggest that it's not configurable, but...there is a setting in the B2C blade. Edit Policy -> Token, session & SSO config called "Access & ID token lifetimes (minutes)"...
    wanna change expiresInMinutes
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    ah, ok. so maybe try something like
    var mobileApp = azureMobileApps({ auth: { expiresInMinutes: 1234 } });
    ?
    Swapnil Tripathi
    @tripathi-swapnil
    okay
    thanks trying the same
    for 5 mins
    need to add 5 only right ?
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    for 5 min seems like it would just be expiresInMinutes: 5
    Swapnil Tripathi
    @tripathi-swapnil
    @ephemorality - have you implemented swagger with it ?
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    no, haven't really done anything yet, just started poking around
    Swapnil Tripathi
    @tripathi-swapnil
    same here
    looking some solution which can serve using code commenting :)
    Swapnil Tripathi
    @tripathi-swapnil
    @ephemorality - expiresInMinutes
    does not work :(
    this is my code
    var context = req.azureMobile;
    
        var validateAuth = auth(context.configuration.auth);
    
        // Validate api-key header against environment variable.
        if(req.get('x-zumo-auth') !== undefined && validateAuth.validate(req.get('x-zumo-auth'))){
    i want 5 min token
    Dale Anderson
    @danderson00
    Sorry for responding so late, it's been crazy busy here. Looks like you sorted out most of the issues. As far as getIdentity goes, you could certainly cache the values in memory; there would be little benefit in caching them to a database as they are cached on the server anyway, the call made by getIdentity is light-weight.
    With token expiry, the tokens are actually minted by the Azure Web Apps authentication ("EasyAuth") as opposed to the Mobile Apps SDK. Just checking with the Easy Auth team if this can be customized.
    @togonow Thanks for the link to Chris' page. I'll send it to our docs people and see what we can come up with.
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    the idea is to store an id in an AAD B2C custom property, and use that for "personal table" authorization rather than the user's id/email. then i can link other arbitrary users so that any users with the same id in the custom property have the same authorization. does that seem like a reasonable approach for linking arbitrary identities (or are you aware of a better approach)?
    Dale Anderson
    @danderson00
    @togonow Many of the scenarios should be covered in the how-to section of the docs - check out the Node.js howtos, .NET server and client SDKs are listed down the left. Is there something significant missing?
    @ephemorality That sounds reasonable. I was considering a similar approach for implementing data security / sharing, i.e. having a custom claim in the JWT token.
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    i've been experimenting with different auth flows. do you know: if i use the implicit grant flow, will ~AAD B2C~ the Azure Web App? still create sessions?
    that is, is stateless auth possible with a node Azure Mobile App + AAD B2C?
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    it looks like the js client is sending a query param to the authorize endpoint session_mode=token, but i haven't been able to find documentation for what that does
    ToGoNow
    @togonow
    Screen Shot 2016-12-02 at 2.50.16 PM.png
    @danderson00 seems something like this page is missing from the azure app service sdk
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    ToGoNow
    @togonow
    yep, that's what i was looking for, thanks a lot
    Dale Anderson
    @danderson00
    @ephemorality I think it should be supported, but I'm not sure. I'd recommend creating a question on stackoverflow - I'll keep an eye out for it and will put the Auth team on to it as soon as I see it.
    Dale Anderson
    @danderson00
    @ephemorality Word from the auth team is that Azure AD does allow setting the lifetime of tokens. Not sure how exactly, but it should be possible.
    Ghost
    @ghost~55e35bf20fc9f982beaf176a
    @danderson00 cool, thanks. cc @Anshdesire
    (that was his question, i had just been suggesting random things to try)
    as for my questions, the problem with stack overflow is that i inevitably have follow-up questions
    Auth team needs a gitter! =)