Questions tagged [scopes]

An OAuth Scope is a permission setting that limits the permissiveness of a given OAuth Token. Clients therefore provide a list of desired Scopes when obtaining a Token (alongside standard OAuth ClientId and Client Authentication details). The Token will then be granted (or not) according to the Authentication process and the Scopes granted for the given Client Id

383 questions
2
votes
1 answer

How to use multiple scopes for Authlib

I am working with Authlib version 0.7. I am trying to give a client access to multiple scopes, the way I do that is on client creation I pass a string delimited by spaces as the scope (for eg 'A B'). When I generate an access token for this client,…
pranav jain
  • 31
  • 1
  • 5
2
votes
1 answer

Slack API Opening a New DM (Scopes and Permissions)

I am attempting to open a DM (Direct Message) with an arbitrary user using the im.open Slack API call. I am sending it a user's user_id that I obtain through their clicking of a consent button in order to begin a series of questions. I am sending…
Cody Berry
  • 263
  • 3
  • 14
2
votes
0 answers

Spring OAuth2 JWT additional information and scopes

I have 2 questions about spring jwt token? The first one is related to the additional informations of the JWT token: - Is there any way to hide the additional informations from the oauth2 jwt token because they are in plain text and the same…
DrDray
  • 55
  • 5
2
votes
1 answer

Rails querying an associated models scope

I am struggling to find a suitable solution for what should be a simple task. Essentially I have a category model which has many posts. The post belongs to the category. I am displaying categories as part of a search form as well as a number of…
Torrm
  • 153
  • 1
  • 14
2
votes
1 answer

Laravel 5.2 eloquent query with local scope

I wanted to know if its possible to use Laravel's local scope between two or more Models using join or sub query? For example this is User model with scope active. class User extends Model { public function scopeActive($query) { return…
Imran Ali
  • 372
  • 5
  • 16
2
votes
1 answer

Rails 5 - Pundit Scopes

I am trying to learn how to use pundit with my Rails 5 app. I'm trying to follow the approach in this article. https://learn.co/lessons/devise_pundit_readme I am struggling to find a working result from this approach. Specifically, the line in my…
Mel
  • 2,481
  • 26
  • 113
  • 273
2
votes
1 answer

Why doesn't the variable stay when I am using the setTimeout method?

var obj = { id: 1, getId: function(){ console.log(this.id) } } obj.getId(); // 1 setTimeout(obj.getId, 1000); // undefined So I am trying to understand that calling the method directly is doing well but when I call it using…
Rohan
  • 13,308
  • 21
  • 81
  • 154
2
votes
1 answer

How can you alias, or otherwise override, a scope and call the original?

A Spree addon adds a scope. Let's say: class Product scope :in_sale, -> { where(in_sale: true) } end Note that the actual scope is slightly more complex. Now, I want to override that in my decorator: Spree::Product.class_eval do scope :in_sale,…
berkes
  • 26,996
  • 27
  • 115
  • 206
2
votes
1 answer

Django-Allauth Scopes not working on any providers

I have added scopes to each provider but I do not receive all the additional data in extra_data. I only receive the default extra data. When using oauth facebook does ask to I will allow the data to be used but I do not recieve the data such as…
2
votes
1 answer

Is @SessionScoped a good practice?

I've read about all the differences between the types of scope (@SessionScoped, @ViewScoped, @ApplicationScope and @RequestScope), however, I'm still facing somehow a problem with my application. I have a page-1 with a grid and I send the selected…
pedroct92
  • 404
  • 1
  • 4
  • 18
2
votes
3 answers

Getting user info in google drive sdk

I am using this three scopes: scopes[0] = "https://www.googleapis.com/auth/drive"; scopes[1] = "https://www.googleapis.com/auth/userinfo.email"; scopes[2] =…
user990635
  • 3,979
  • 13
  • 45
  • 66
2
votes
2 answers

ActiveRecord merges current where conditions when applying a scope?

I have encountered some unexpected behavior in Active Record (3.2.13): There is a simple scope on my model: class User < ActiveRecord::Base scope :verified, lambda { where('verified = 1') } end This can be used fine on its own: …
crispy
  • 5,737
  • 4
  • 33
  • 45
2
votes
2 answers

Best practices for displaying different data when using the same partials in Rails

Just a question related to Rails best practices: Say we have a Post and a Comment model. The same partial is used to render the post on both the index view and the show view. Inside that partial is a reference to another partial that renders the…
Christian
  • 19,605
  • 3
  • 54
  • 70
2
votes
3 answers

Make class variable available in other scopes? c++

In the constructor of a class I have I create an array with the needed size like this: ArrayClass::ArrayClass(int size) { Number* nmbr = new Number[size]; } and ArrayClass::ArrayClass() { Number* nmbr = new Number[2]; } I also have it…
Kraffs
  • 533
  • 2
  • 7
  • 22
2
votes
3 answers

Multiple arguments in a scope

This is probably simple for most of you out there, I however havent really written many scopes that have multiple arguments, single arguments are fine, just unsure here. I am trying to create a scope that says "Give me all the books that the current…
Richlewis
  • 15,070
  • 37
  • 122
  • 283