10,000 Matching Annotations
  1. Dec 2023
    1. && nil

      first sighting: I don't think I've seen someone write exactly && nil before.

      Apparently to avoid having the return value from errors.add — which should be done solely for its side effect, not to get a return value -- inadvertently being used as a return value for user. It wouldn't make sense to return from user. That should only return a User or nil. And more statically typed languages would allow that to be expressed/enforced from type annotations alone, which would have caught the mistake of returning errors.add if someone had accidentally attempted to return that.

      Having user (and therefore call) return nil is key to the unless @current_user working.

    1. The thing most obvious about the type systems of Java, C, C++, Pascal, and many other widely-used “industry” languages is not that they are statically typed, but that they are explicitly typed.In other words, they require lots of type declarations. (In the world of less explicitly typed languages, where these declarations are optional, they are often called “type annotations”.) This has nothing to do with static types. continued
    1. describe AuthenticateUser do subject(:context) { described_class.call(username, password) } describe '.call' do context 'when the context is successful' do let(:username) { 'correct_user' } let(:password) { 'correct_password' } it 'succeeds' do expect(context).to be_success end end context 'when the context is not successful' do let(:username) { 'wrong_user' } let(:password) { 'wrong_password' } it 'fails' do expect(context).to be_failure end end end end
    1. I disagree. What is expressed is an attempt to solve X by making something that should maybe be agnostic of time asynchronous. The problem is related to design: time taints code. You have a choice: either you make the surface area of async code grow and grow or you treat it as impure code and you lift pure synchronous logic in an async context. Without more information on the surrounding algorithm, we don't know if the design decision to make SymbolTable async was the best decision and we can't propose an alternative. This question was handled superficially and carelessly by the community.

      superficially and carelessly?

    2. because the value isn't there yet. A promise is just a marker that it will be available at some point in the future. You cannot convert asynchronous code to synchronous, though. If you order a pizza, you get a receipt that tells you that you will have a pizza at some point in the future. You cannot treat that receipt as the pizza itself, though. When you get your number called you can "resolve" that receipt to a pizza. But what you're describing is trying to eat the receipt.
    1. for security, app access token should never be hard-coded into client-side code, doing so would give everyone who loaded your webpage or decompiled your app full access to your app secret, and therefore the ability to modify your app. This implies that most of the time, you will be using app access tokens only in server to server calls.
    2. once you have an access token you can use it to make calls from a mobile client, a web browser, or from your server to Facebook's servers. If a token is obtained on a client, you can ship that token down to your server and use it in server-to-server calls. If a token is obtained via a server call, you can also ship that token up to a client and then make the calls from the client.
    3. A User access token is used if your app takes actions in real time, based on input from the user. This kind of access token is needed any time the app calls an API to read, modify or write a specific person's Facebook data on their behalf. A User access tokens is generally obtained via a login dialog and requires a person to permit your app to obtain one.
    1. Are you two serious? Instead of advocating to fix this bug you go out of your way to post another bug report to advocate the devs to dig in their heels?! How about standardizing some devastating needed questions in the technology industry: 1. How does this help productive members of society? 2. Does this serve a useful purpose? 3. Should I be doing this? 4. Have I had a full, non-interrupted, rational conversation with multiple people who disagrees to help determine if I have objectively determined my answers to the first three questions?
    1. In cases where Google is authoritative the user is confirmed to be the legitimate account owner.

      What about in other cases? The user may have created an account using someone else's e-mail address? Isn't e-mail verification a required step to create the Google Account though? I think so. I think the only case it is trying to warn us of is the one mentioned below:

      email_verfied can also be true as Google initially verified the user when the Google Account was created, however ownership of the third party email account may have since changed.

    1. An invariant (in common sense) means some conditions that must be true at some point in time or even always while your program is executing. e.g. PreConditions and PostConditions can be used to assert some conditions that must be true when a function is called and when it returns. Object invariants can be used to assert that a object must have a valid state throughout the time it exists. This is the design by contract principle.
    2. In OOP, an invariant is a set of assertions that must always hold true during the life of an object for the program to be valid. It should hold true from the end of the constructor to the start of the destructor whenever the object is not currently executing a method that changes its state.
    1. an invariant is something like of a fixed relationship between varying entities. For example, your age will always be less than that compared to your biological parents. Both your age, and your parent's age changes in the passage of time, but the relationship that i mentioned above is an invariant.
    2. For instance, a binary search tree might have the invariant that for every node, the key of the node's left child is less than the node's own key. A correctly written insertion function for this tree will maintain that invariant. As you can tell, that's not the sort of thing you can store in a variable: it's more a statement about the program. By figuring out what sort of invariants your program should maintain, then reviewing your code to make sure that it actually maintains those invariants, you can avoid logical errors in your code.
    1. The secure OAuth 2.0 protocol lets you safely link a user's Google Account with their account on your platform, thereby granting Google applications and devices access to your services.

      What I still don't understand is... How do you even initiate the Google app to request such access? How would you trigger that? It's not going to show a list of all 100,000 registered apps and ask which of those you'd like to add...

    1. This describes account linking from the opposite direction than I'm used to: starting with the Google App, which requests your app to share data from your service with Google.

      As it says on https://developers.google.com/identity/account-linking overview:

      The secure OAuth 2.0 protocol lets you safely link a user's Google Account with their account on your platform, thereby granting Google applications and devices access to your services.

    1. A traditional account linking flow requires the user to enter their credentials in the browser. The use of App Flip defers user sign-in to your Android app, which allows you to leverage existing authorizations. If the user is signed in to your app, they don't need to re-enter their credentials to link their account.
    1. To perform account linking with OAuth and Google Sign-In, follow these general steps: First, ask the user to give consent to access their Google profile. Use the information in their profile to check if the user account exists. For existing users, link the accounts. If you can't find a match for the Google user in your authentication system, validate the ID token received from Google. You can then create a user based on the profile information contained in the ID token.
    1. Don't reply or click any links in a spam message Replying to, clicking on links within, or even attempting to unsubscribe from spam emails typically only informs the sender that they have found an active email address to which they'll send more spam emails.
    1. A personalized button gives users a quick indication of the session status, both on Google's side and on your website, before they click the button. This is especially helpful to end users who visit your website only occasionally. They may forget whether an account has been created or not, and in which way. A personalized button reminds them that Sign In With Google has been used before. Thus, it helps to prevent unnecessary duplicate account creation on your website.

      first sighting: sign-in: problem: forgetting whether an account has been created or not, and in which way

    1. After you have verified the token, check if the user is already in your user database. If so, establish an authenticated session for the user. If the user isn't yet in your user database, create a new user record from the information in the ID token payload, and establish a session for the user. You can prompt the user for any additional profile information you require when you detect a newly created user in your app.
  2. Nov 2023
    1. We didn't add this initially because Google is not the only form of authentication we offer and it could get annoying for users that sign up with GitHub or username and password to see the Google popup all the time.
    1. At a later time, when accessing data from Google is required, you call the authorization API to ask for the consent and get access tokens for data access. This separation complies with our recommended incremental authorization best practice, in which the permissions are requested in context.
    1. The Sign in with Google button redirect flow always uses the POST method to submit the credential to your web server, whereas OAuth redirect normally uses the GET method.

      How does it both do a POST and a redirect? A redirect is by definition a GET. So I assume it does the POST first with the more sensitive and then a GET without the more sensitive data to the redirect URI?

    2. The user's Google account sign-in status and your app are independent of each other, except during the sign-in moment itself when you know that the user has successfully authenticated and is signed into their Google account. Users may remain signed in, they may sign out, or switch to a different Google account while maintaining an active, signed-in session on your website.
    1. In contrast to One Tap, the Sign in with Google button flow must be triggered by a user gesture.

      "One tap" sounds like a user gesture -- sounds the same as tapping on a button. So I don't yet see the distinction they are trying to make or undertsand the difference between these options...

    2. A personalized button reminds end users that they have used Sign in with Google before, and thus helps to prevent unnecessary duplicate account creation on your website. This is especially helpful to end users who visit your website only occasionally. They may forget the login methods they used.
    1. The signed-in status of a Google Account, and your app's session state and signed-in status are distinct, separate concepts. User sign-in status to their Google Account and your app are independent of each other
    1. If you have any Workspace organization, and the app is only accessible to users within their own org, then we allow non-public domains for projects in "Internal" mode. See this link on how to make the project internal.

      didn't work for me

    1. In development, I was able to reset the exponential cool down by removing the g_state cookie. One method for this might be to add a development-only "Clear Google One Tap Cookie" link that run an server-side action to remove the g_state cookie and then redirect back to the previous page.
    1. The PSL nor its volunteers prescribe what browsers do with entries or their recognition/handling of entries, default behaviours, or other handling. Browsers do what browsers do, diversely, and the PSL is not the boss of them.
    1. It does provide an answer. The issue is that the Google form validates that the user has input a valid looking URL. So he needs to input an arbitrary, but valid URL, and then add that to /etc/hosts so his browser will resolve it to the address of his devserver. The question and answer are both fine as is and don't require any critique or clarification.

      The critical comment this was apparently in reply to was apparently deleted

    2. You can set "Authorized redirect URI" to local IP (like http://127.0.0.1/callback), it's working fine for me. What really agonizing is that google don't allow user to config an external IP (let's say your server IP like 99.99.99.99) as "Authorized redirect URI", google want the "Authorized redirect URI" to end with a public top-level domain (such as .com or .org).

      Trying to use a local .test domain results in: Invalid Origin: must end with a public top-level domain (such as .com or .org).

      but local IP is allowed. Why this inconsistency?

      And then this one: can use external domain, but not external IP?!

    1. The problem is that when I want to create OAuth client ID in google, it does not accept ".test" domain for "Authorized redirect URIs". It says: Invalid Redirect: must end with a public top-level domain (such as .com or .org). Invalid Redirect: domain must be added to the authorized domains list before submitting. While it accepts .test domain for "Authorized JavaScript origins" part! I saw most of the tutorials when using socialite and google api they set these in google console. http://localhost:8000 and http://localhost:8000/callback/google and google accepts them without problem with domain and generate the key and secret but I am not using mamp and I am going to continue with valet. I would be so thankful if you guide me about what is the alternative domain for .test which works fine in valet and also google accepts it?
    1. AIs are not capable of citing the sources of knowledge used up to the standards of the Stack Exchange network. Even when Artificial Intelligence appears to cite sources for responses, such sources may not be relevant to the original request, or may not exist at all. For Stack Overflow, this means the answer may not honestly or fairly represent the sources of knowledge used, even if someone explicitly cites the Artificial Intelligence as an author in their answer.
    1. Smarter user improvements: When users sign in to an app or site using their social network, site owners can analyze data from that platform to establish user preferences. Developers can then use this insight to create customizable user experiences and build features that are in demand.

      vague

    1. Users can use multiple Identity Providers to sign in, and Okta can link all of those profiles to a single Okta user. This is called account linking. For example, a user signs in to your app using a different Identity Provider than they used for registration. Account linking can then establish that the user owns both identities. This allows the user to sign in from either account.
    1. One such way that social media accounts are exploited is when users are enticed to download malicious browser extensions that request read and write permissions on all websites. These users are not aware that later on, typically a week or so after being installed, the extensions will then download some background Javascript malware from its command and control site to run on the user's browser.
    1. It’s an unfortunate fact that many people use the same credentials to log into different accounts. This password practice is a big part of what enables account takeovers, as it increases the likelihood that hackers can use compromised credentials to access sensitive information across accounts.
    2. As a prevention method, organizations should consider implementing passwordless practices like fingerprints or facial recognition, as well as modern authentication standards like WebAuthn, which remove passwords from the authentication experience. When organizations opt for these authentication methods, they help to mitigate the risk of stolen credentials, and minimize the chance of account takeovers.
    3. For organizations where passwordless authentication is not yet possible, the next best option is to use adaptive multi-factor authentication (Adaptive MFA) as a security measure. This approach monitors the user’s login behavior on the basis of location, device, network, and more to determine which authentication methods to use. If the risk factor is high, then the user would be asked to submit an additional identifying factor such as an TOTP code or a one-time password.

      adaptive multi-factor authentication

    4. In retail or e-commerce settings, this is particularly effective as hackers will often change details, including the shipping or email address, associated with the account. By reacting to that type of change and requesting an additional factor, adaptive MFA can better protect a customer’s sensitive data.

      adaptive multi-factor authentication

    1. organization to user relationship

      I think "user to organization" relationship would be more accurate.

      The "organization to user relationship" seems like it would be the opposite direction: employer, supplier, etc.

    1. The args object is the only mechanism via which data may be injected into the callback, the callback is not a closure and does not retain access to the JavaScript context in which it was declared. Values passed into args must be serializable.
    1. Autoloading in Rails was based on const_missing up to Rails 5. That callback lacks fundamental information like the nesting or the resolution algorithm being used. Because of that, Rails autoloading was not able to match Ruby's semantics, and that introduced a series of issues. Zeitwerk is based on a different technique and fixed Rails autoloading starting with Rails 6.